### Question:
XmlUtil { public static Document parseStream(InputStream stream, VALIDATION_TYPE validation, boolean expandEntityRefs) throws SAXException, IOException { return parseStream(stream, new LocalDTDEntityResolver(), validation, expandEntityRefs); }  static boolean isXMLReservedNamespace(String namespace); static void removeEntities(Reader reader, Writer writer); static String removeEntities(String string); static void rewriteEntities(Reader reader, Writer writer); static Document parseStream(InputStream stream, VALIDATION_TYPE validation,
                                       boolean expandEntityRefs); static Document parseStream(InputStream stream,
                                       EntityResolver entityResolver, VALIDATION_TYPE validation,
                                       boolean expandEntityRefs); static Document parseStream(Reader stream,
                                       EntityResolver entityResolver, VALIDATION_TYPE validation,
                                       boolean expandEntityRefs); static Document parseStream(InputStream stream); static Document parseStream(Reader stream); static Document parseStream(Reader stream, final ErrorHandler errorHandler); static NodeList getNodeList(Node node, String xpath); static Node getNode(Node node, String xpath); static String getString(Node node, String xpath); static Element createElement(String localPart); static Element createElementNS(String namespace, String localPart); static String serialize(NodeList nodeList); static String serialize(final Node node, boolean format); static void serialize(final Node node, boolean format, Writer writer); static String serialize(NodeList nodeList, boolean format); static void serialize(NodeList nodeList, boolean format, Writer writer); static String indent(String xml, int indent); static boolean isTextNode(Node node); static void encodeTextValue(char[] characters, int offset, int length, Writer writer); static void encodeAttributeValue(char[] characters, int offset, int length, Writer writer); static final DocumentBuilder documentBuilder; static final char[] LT; static final char[] GT; static final char[] AMP; static final char[] QUOT; static final char[] APOS; }### Answer:
@Test public void testParseStream() { try { Document doc = XmlUtil.parseStream(getClass().getResourceAsStream( "/a.adf"), new LocalDTDEntityResolver(getDTDfolder()), XmlUtil.VALIDATION_TYPE.DTD, true); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } try { Document doc = XmlUtil.parseStream(getClass().getResourceAsStream( "/b.adf"), new LocalDTDEntityResolver(getDTDfolder()), XmlUtil.VALIDATION_TYPE.DTD, true); fail("No failure for invalid document."); } catch (SAXException e) { } catch (IOException e) { e.printStackTrace(); fail(e.getMessage()); } }