@Test
public void testDecodeTypical() throws IOException {

  SsaDecoder decoder = new SsaDecoder();
  byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL);
  Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
  assertThat(subtitle.getEventTimeCount()).isEqualTo(6);
  // Check position, line, anchors & alignment are set from Alignment Style (2 - bottom-center).
  Cue firstCue = subtitle.getCues(subtitle.getEventTime(0)).get(0);
  assertWithMessage("Cue.textAlignment")
      .that(firstCue.textAlignment)
      .isEqualTo(Layout.Alignment.ALIGN_CENTER);
  assertWithMessage("Cue.positionAnchor")
      .that(firstCue.positionAnchor)
      .isEqualTo(Cue.ANCHOR_TYPE_MIDDLE);
  assertWithMessage("Cue.position").that(firstCue.position).isEqualTo(0.5f);
  assertWithMessage("Cue.lineAnchor").that(firstCue.lineAnchor).isEqualTo(Cue.ANCHOR_TYPE_END);
  assertWithMessage("Cue.lineType").that(firstCue.lineType).isEqualTo(Cue.LINE_TYPE_FRACTION);
  assertWithMessage("Cue.line").that(firstCue.line).isEqualTo(0.95f);
  assertTypicalCue1(subtitle, 0);
  assertTypicalCue2(subtitle, 2);
  assertTypicalCue3(subtitle, 4);
}