@Test
public void testInitializationDecodeWithStyl() throws IOException, SubtitleDecoderException {

  byte[] initBytes =
      TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), INITIALIZATION);
  Tx3gDecoder decoder = new Tx3gDecoder(Collections.singletonList(initBytes));
  byte[] bytes =
      TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), SAMPLE_WITH_STYL);
  Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
  SpannedString text = new SpannedString(subtitle.getCues(0).get(0).text);
  assertThat(text.toString()).isEqualTo("CC Test");
  assertThat(text.getSpans(0, text.length(), Object.class)).hasLength(5);
  StyleSpan styleSpan = findSpan(text, 0, text.length(), StyleSpan.class);
  assertThat(styleSpan.getStyle()).isEqualTo(Typeface.BOLD_ITALIC);
  findSpan(text, 0, text.length(), UnderlineSpan.class);
  TypefaceSpan typefaceSpan = findSpan(text, 0, text.length(), TypefaceSpan.class);
  assertThat(typefaceSpan.getFamily()).isEqualTo(C.SERIF_NAME);
  ForegroundColorSpan colorSpan = findSpan(text, 0, text.length(), ForegroundColorSpan.class);
  assertThat(colorSpan.getForegroundColor()).isEqualTo(Color.RED);
  colorSpan = findSpan(text, 0, 6, ForegroundColorSpan.class);
  assertThat(colorSpan.getForegroundColor()).isEqualTo(Color.GREEN);
  assertFractionalLinePosition(subtitle.getCues(0).get(0), 0.1f);
}