@Test
public void testDecodeCommentFrame() {

  byte[] rawId3 = buildSingleFrameTag("COMM", new byte[] {ID3_TEXT_ENCODING_UTF_8, 101, 110, 103,
      100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 0, 116, 101, 120, 116, 0});
  Id3Decoder decoder = new Id3Decoder();
  Metadata metadata = decoder.decode(rawId3, rawId3.length);
  assertThat(metadata.length()).isEqualTo(1);
  CommentFrame commentFrame = (CommentFrame) metadata.get(0);
  assertThat(commentFrame.language).isEqualTo("eng");
  assertThat(commentFrame.description).isEqualTo("description");
  assertThat(commentFrame.text).isEqualTo("text");
  // Test empty.
  rawId3 = buildSingleFrameTag("COMM", new byte[0]);
  metadata = decoder.decode(rawId3, rawId3.length);
  assertThat(metadata.length()).isEqualTo(0);
  // Test language only.
  rawId3 = buildSingleFrameTag("COMM", new byte[] {ID3_TEXT_ENCODING_UTF_8, 101, 110, 103});
  metadata = decoder.decode(rawId3, rawId3.length);
  assertThat(metadata.length()).isEqualTo(1);
  commentFrame = (CommentFrame) metadata.get(0);
  assertThat(commentFrame.language).isEqualTo("eng");
  assertThat(commentFrame.description).isEmpty();
  assertThat(commentFrame.text).isEmpty();
}