@Test
public void testAdvanceToEndOfBuffer() {

  writeTestData();
  int skipCount = sampleQueue.advanceTo(LAST_SAMPLE_TIMESTAMP);
  // Should advance to 2nd keyframe (the 4th frame).
  assertThat(skipCount).isEqualTo(4);
  assertReadTestData(null, DATA_SECOND_KEYFRAME_INDEX);
  assertNoSamplesToRead(FORMAT_2);
}