### Question:
XmlUtils { public static Element parseXml(String xmlStr) throws JDOMException { Objects.requireNonNull(xmlStr, "xmlStr cannot be null"); try { SAXBuilder saxBuilder = createSAXBuilder(); Document document = saxBuilder.build(new StringReader(xmlStr)); return document.getRootElement(); } catch (IOException ex) { throw new RuntimeException("Xml parsing failed, " + ex.getMessage(), ex); } }  static String removeComments(String xmlStr); static Element parseXml(String xmlStr); static Element parseXml(InputStream is); static String getRootAttribute(String filePath, String attributeName); static PrettyPrint prettyPrint(Element element); static PrettyPrint prettyPrint(String xmlStr); static PrettyPrint prettyPrint(Configuration conf); static void validateXml(Schema schema, String xml); static void validateData(String xmlData, SchemaName xsdFile); static String writePropToString(Properties props); static String escapeCharsForXML(String aText); static Element getSLAElement(Element elem);  }### Answer:
@Test public void testExternalEntity() throws Exception { try { XmlUtils.parseXml(EXTERNAL_ENTITY_XML); fail("DOCTYPE should not be allowed"); } catch (JDOMParseException e) { assertTrue("Exception has different message.", e.getMessage(). contains("DOCTYPE is disallowed when the feature \"http: + "org/xml/features/disallow-doctype-decl\" set to true")); } }