@Test
public void xxeTestFromInputStream() throws IOException {

    InputStream inputStream = null;
    try {
        inputStream = new ByteArrayInputStream(XMP_WITH_XXE.getBytes());
        XMPMetaParser.parse(inputStream, null);
    } catch (XMPException e) {
        Assert.assertEquals("Children of resource property element must be XML elements", e.getMessage());
    } finally {
        if (inputStream != null) {
            inputStream.close();
        }
    }
}