@Test
public void testDecodeTypicalUnexpectedEnd() throws IOException {

  // Parsing should succeed, parsing the first and second cues only.
  SubripDecoder decoder = new SubripDecoder();
  byte[] bytes =
      TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL_UNEXPECTED_END);
  Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
  assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
  assertTypicalCue1(subtitle, 0);
  assertTypicalCue2(subtitle, 2);
}