@Test
public void testDecodeTextInformationFrame() {

  byte[] rawId3 = buildSingleFrameTag("TIT2", new byte[] {3, 72, 101, 108, 108, 111, 32, 87, 111,
      114, 108, 100, 0});
  Id3Decoder decoder = new Id3Decoder();
  Metadata metadata = decoder.decode(rawId3, rawId3.length);
  assertThat(metadata.length()).isEqualTo(1);
  TextInformationFrame textInformationFrame = (TextInformationFrame) metadata.get(0);
  assertThat(textInformationFrame.id).isEqualTo("TIT2");
  assertThat(textInformationFrame.description).isNull();
  assertThat(textInformationFrame.value).isEqualTo("Hello World");
  // Test empty.
  rawId3 = buildSingleFrameTag("TIT2", new byte[0]);
  metadata = decoder.decode(rawId3, rawId3.length);
  assertThat(metadata.length()).isEqualTo(0);
  // Test encoding byte only.
  rawId3 = buildSingleFrameTag("TIT2", new byte[] {ID3_TEXT_ENCODING_UTF_8});
  metadata = decoder.decode(rawId3, rawId3.length);
  assertThat(metadata.length()).isEqualTo(1);
  textInformationFrame = (TextInformationFrame) metadata.get(0);
  assertThat(textInformationFrame.id).isEqualTo("TIT2");
  assertThat(textInformationFrame.description).isNull();
  assertThat(textInformationFrame.value).isEmpty();
}