class ReplaceSyncSamplesList extends AbstractList<Sample> {
        List<Sample> parentSamples;

        public ReplaceSyncSamplesList(List<Sample> parentSamples) {
            this.parentSamples = parentSamples;
        }

        @Override
        public Sample get(final int index) {<FILL_FUNCTION_BODY>}

        @Override
        public int size() {
            return parentSamples.size();
        }


    }

            final Sample orignalSample = parentSamples.get(index);
            if (orignalSample.getSampleEntry().getType().equals("avc1") &&  Arrays.binarySearch(Avc1ToAvc3TrackImpl.this.getSyncSamples(), index + 1) >= 0) {

                final AvcConfigurationBox avcC = orignalSample.getSampleEntry().getBoxes(AvcConfigurationBox.class).get(0);
                final int len = avcC.getLengthSizeMinusOne() + 1;
                final ByteBuffer buf = ByteBuffer.allocate(len);

                final SampleEntry se = avc1toavc3.get(orignalSample.getSampleEntry());


                return new Sample() {

                    public SampleEntry getSampleEntry() {
                        return se;
                    }

                    public void writeTo(WritableByteChannel channel) throws IOException {

                        for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {
                            IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) ((Buffer)buf).rewind(), len);
                            channel.write((ByteBuffer) ((Buffer)buf).rewind());
                            channel.write(bytes);
                        }
                        for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {
                            IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) ((Buffer)buf).rewind(), len);
                            channel.write((ByteBuffer) ((Buffer)buf).rewind());
                            channel.write((bytes));
                        }
                        for (ByteBuffer bytes : avcC.getPictureParameterSets()) {
                            IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) ((Buffer)buf).rewind(), len);
                            channel.write((ByteBuffer) ((Buffer)buf).rewind());
                            channel.write((bytes));
                        }
                        orignalSample.writeTo(channel);
                    }

                    public long getSize() {

                        int spsPpsSize = 0;
                        for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {
                            spsPpsSize += len + bytes.limit();
                        }
                        for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {
                            spsPpsSize += len + bytes.limit();
                        }
                        for (ByteBuffer bytes : avcC.getPictureParameterSets()) {
                            spsPpsSize += len + bytes.limit();
                        }
                        return orignalSample.getSize() + spsPpsSize;
                    }

                    public ByteBuffer asByteBuffer() {

                        int spsPpsSize = 0;
                        for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {
                            spsPpsSize += len + bytes.limit();
                        }
                        for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {
                            spsPpsSize += len + bytes.limit();
                        }
                        for (ByteBuffer bytes : avcC.getPictureParameterSets()) {
                            spsPpsSize += len + bytes.limit();
                        }


                        ByteBuffer data = ByteBuffer.allocate(l2i(orignalSample.getSize()) + spsPpsSize);
                        for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {
                            IsoTypeWriterVariable.write(bytes.limit(), data, len);
                            data.put(bytes);
                        }
                        for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {
                            IsoTypeWriterVariable.write(bytes.limit(), data, len);
                            data.put(bytes);
                        }
                        for (ByteBuffer bytes : avcC.getPictureParameterSets()) {
                            IsoTypeWriterVariable.write(bytes.limit(), data, len);
                            data.put(bytes);
                        }
                        data.put(orignalSample.asByteBuffer());
                        return (ByteBuffer) ((Buffer)data).rewind();
                    }
                };

            } else {
                return orignalSample;
            }
        
<methods>public void <init>(org.mp4parser.muxer.Track) ,public void close() throws java.io.IOException,public List<org.mp4parser.boxes.iso14496.part12.CompositionTimeToSample.Entry> getCompositionTimeEntries() ,public long getDuration() ,public List<org.mp4parser.muxer.Edit> getEdits() ,public java.lang.String getHandler() ,public java.lang.String getName() ,public List<org.mp4parser.boxes.iso14496.part12.SampleDependencyTypeBox.Entry> getSampleDependencies() ,public long[] getSampleDurations() ,public List<org.mp4parser.boxes.sampleentry.SampleEntry> getSampleEntries() ,public Map<org.mp4parser.boxes.samplegrouping.GroupEntry,long[]> getSampleGroups() ,public List<org.mp4parser.muxer.Sample> getSamples() ,public org.mp4parser.boxes.iso14496.part12.SubSampleInformationBox getSubsampleInformationBox() ,public long[] getSyncSamples() ,public org.mp4parser.muxer.TrackMetaData getTrackMetaData() <variables>private org.mp4parser.muxer.Track parent