### Question:
SampleQueue implements TrackOutput { public void setSampleOffsetUs(long sampleOffsetUs) { if (this.sampleOffsetUs != sampleOffsetUs) { this.sampleOffsetUs = sampleOffsetUs; pendingFormatAdjustment = true; } } SampleQueue(Allocator allocator); void reset(); void reset(boolean resetUpstreamFormat); void sourceId(int sourceId); void splice(); int getWriteIndex(); void discardUpstreamSamples(int discardFromIndex); boolean hasNextSample(); int getFirstIndex(); int getReadIndex(); int peekSourceId(); Format getUpstreamFormat(); long getLargestQueuedTimestampUs(); boolean isLastSampleQueued(); long getFirstTimestampUs(); void rewind(); void discardTo(long timeUs, boolean toKeyframe, boolean stopAtReadPosition); void discardToRead(); void discardToEnd(); int advanceToEnd(); int advanceTo(long timeUs, boolean toKeyframe, boolean allowTimeBeyondBuffer); boolean setReadPosition(int sampleIndex); int read(
      FormatHolder formatHolder,
      DecoderInputBuffer buffer,
      boolean formatRequired,
      boolean loadingFinished,
      long decodeOnlyUntilUs); void setUpstreamFormatChangeListener(UpstreamFormatChangedListener listener); void setSampleOffsetUs(long sampleOffsetUs); @Override void format(Format format); @Override int sampleData(ExtractorInput input, int length, boolean allowEndOfInput); @Override void sampleData(ParsableByteArray buffer, int length); @Override void sampleMetadata(
      long timeUs,
      @C.BufferFlags int flags,
      int size,
      int offset,
      @Nullable CryptoData cryptoData); static final int ADVANCE_FAILED; }### Answer:
@Test public void testSetSampleOffset() { long sampleOffsetUs = 1000; sampleQueue.setSampleOffsetUs(sampleOffsetUs); writeTestData(); assertReadTestData(null, 0, 8, sampleOffsetUs); assertReadEndOfStream(false); }