@Test
public void testSetSampleOffsetBeforeData() {

  long sampleOffsetUs = 1000;
  sampleQueue.setSampleOffsetUs(sampleOffsetUs);
  writeTestData();
  assertReadTestData(
      /* startFormat= */ null, /* firstSampleIndex= */ 0, /* sampleCount= */ 8, sampleOffsetUs);
  assertReadEndOfStream(/* formatRequired= */ false);
}