@Test
public void parsePngWithItxtChunk() throws Exception {

    final String EXPECTED_ITXTTITLE_VALUE = "PngSuite";
    final String EXPECTED_ITXTDISCLAIMER_VALUE = "Freeware.";
    final String PROP_KEYWORDS = "Keywords";
    final String PROP_VALUE = "Value";
    File pngFile = new File(ITXTCHUNK_PNG_FILEPATH);
    RepInfo info = new RepInfo(pngFile.getAbsolutePath());
    PngModule pngMod = new PngModule();
    pngMod.parse(new FileInputStream(pngFile), info, 0);
    int wellformed = info.getWellFormed();
    int valid = info.getValid();
    String type = info.getMimeType();
    // General checks
    assertEquals(1, wellformed);
    assertEquals(1, valid);
    assertEquals(PNG_MIMETYPE, type);
    // Check the value of the first iTXt is as expected
    Set<String> keywordValues = new HashSet<String>();
    @SuppressWarnings("unchecked")
    LinkedList<Property> iTxtKeywordProperties = (LinkedList<Property>) info.getByName(PROP_KEYWORDS).getValue();
    for (Property prop : iTxtKeywordProperties) {
        keywordValues.add(prop.getByName(PROP_VALUE).getValue().toString());
    }
    assertEquals(6, keywordValues.size());
    assertTrue(keywordValues.contains(EXPECTED_ITXTTITLE_VALUE));
    assertTrue(keywordValues.contains(EXPECTED_ITXTDISCLAIMER_VALUE));
}