@Test
public void testAdvanceToEnd() {

  writeTestData();
  sampleQueue.advanceToEnd();
  assertAllocationCount(10);
  sampleQueue.discardToRead();
  assertAllocationCount(0);
  // Despite skipping all samples, we should still read the last format, since this is the
  // expected format for a subsequent sample.
  assertReadFormat(false, FORMAT_2);
  // Once the format has been read, there's nothing else to read.
  assertNoSamplesToRead(FORMAT_2);
}