### Question:
ValidatorNuParser extends BaseDocumentParser { @Override public Document parse(InputSource inputSource) throws ParserException { try { HtmlDocumentBuilder builder = new HtmlDocumentBuilder(); Document document = builder.parse(inputSource); String systemId = inputSource.getSystemId(); if (StringUtils.isNotEmpty(systemId)) { document.setDocumentURI(systemId); } return document; } catch (SAXException | IOException e) { throw new ParserException(e); } } protected  ValidatorNuParser(); @Override Document parse(InputSource inputSource);  }### Answer:
@Test public void testNeko3109537() throws FileNotFoundException, ParserException { htmlParser.parse(ResourceHelper.getResourceFile("/webPages/NekoTestcase3109537.html")); }
@Test public void testNekoTrNamespace() throws FileNotFoundException, ParserException { Document document = htmlParser.parse(ResourceHelper.getResourceFile("/webPages/NekoTrNamespaceTest.html")); Node node = XPathHelper.getXhtmlNode(document, " assertNotNull(node); node = XPathHelper.getNode(document, " assertNull(node); }
@Test public void testParseMixedNamespaces() throws FileNotFoundException, ParserException { Document document = htmlParser.parse(ResourceHelper.getResourceFile("/webPages/xhtml-mathml-svg.xhtml")); assertEquals(4, XPathHelper.getXhtmlNodes(document, "/html/body/ul[1]/li").size()); }
@Test public void testKeepDocumentUriFromInputSource() throws Exception { InputSource inputSource = new InputSource(ResourceHelper.getResourceStream("/apiresponse/googleResult.html")); String url = "http: inputSource.setSystemId(url); Document document = htmlParser.parse(inputSource); assertEquals(url, document.getDocumentURI()); }