@Test
public void testDecodeCueWithTag() throws IOException {

  SubripDecoder decoder = new SubripDecoder();
  byte[] bytes =
      TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL_WITH_TAGS);
  Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
  assertTypicalCue1(subtitle, 0);
  assertTypicalCue2(subtitle, 2);
  assertTypicalCue3(subtitle, 4);
  assertThat(subtitle.getCues(subtitle.getEventTime(6)).get(0).text.toString())
      .isEqualTo("This { \\an2} is not a valid tag due to the space after the opening bracket.");
  assertThat(subtitle.getCues(subtitle.getEventTime(8)).get(0).text.toString())
      .isEqualTo("This is the fifth subtitle with multiple valid tags.");
  assertAlignmentCue(subtitle, 10, Cue.ANCHOR_TYPE_END, Cue.ANCHOR_TYPE_START); // {/an1}
  assertAlignmentCue(subtitle, 12, Cue.ANCHOR_TYPE_END, Cue.ANCHOR_TYPE_MIDDLE); // {/an2}
  assertAlignmentCue(subtitle, 14, Cue.ANCHOR_TYPE_END, Cue.ANCHOR_TYPE_END); // {/an3}
  assertAlignmentCue(subtitle, 16, Cue.ANCHOR_TYPE_MIDDLE, Cue.ANCHOR_TYPE_START); // {/an4}
  assertAlignmentCue(subtitle, 18, Cue.ANCHOR_TYPE_MIDDLE, Cue.ANCHOR_TYPE_MIDDLE); // {/an5}
  assertAlignmentCue(subtitle, 20, Cue.ANCHOR_TYPE_MIDDLE, Cue.ANCHOR_TYPE_END); // {/an6}
  assertAlignmentCue(subtitle, 22, Cue.ANCHOR_TYPE_START, Cue.ANCHOR_TYPE_START); // {/an7}
  assertAlignmentCue(subtitle, 24, Cue.ANCHOR_TYPE_START, Cue.ANCHOR_TYPE_MIDDLE); // {/an8}
  assertAlignmentCue(subtitle, 26, Cue.ANCHOR_TYPE_START, Cue.ANCHOR_TYPE_END); // {/an9}
}