@Test
public void testParseStrictValidClassesAndTrailingTokens() throws Exception {

  Spanned text = parseCueText("<v.first.loud Esme>"
      + "This <u.style1.style2 some stuff>is</u> text with <b.foo><i.bar>html</i></b> tags");
  assertThat(text.toString()).isEqualTo("This is text with html tags");
  UnderlineSpan[] underlineSpans = getSpans(text, UnderlineSpan.class);
  StyleSpan[] styleSpans = getSpans(text, StyleSpan.class);
  assertThat(underlineSpans).hasLength(1);
  assertThat(styleSpans).hasLength(2);
  assertThat(styleSpans[0].getStyle()).isEqualTo(ITALIC);
  assertThat(styleSpans[1].getStyle()).isEqualTo(BOLD);
  assertThat(text.getSpanStart(underlineSpans[0])).isEqualTo(5);
  assertThat(text.getSpanEnd(underlineSpans[0])).isEqualTo(7);
  assertThat(text.getSpanStart(styleSpans[0])).isEqualTo(18);
  assertThat(text.getSpanStart(styleSpans[1])).isEqualTo(18);
  assertThat(text.getSpanEnd(styleSpans[0])).isEqualTo(22);
  assertThat(text.getSpanEnd(styleSpans[1])).isEqualTo(22);
}