### Question:
DocumentManipulator { protected Document parseDocument(File file) throws DocumentManipulatorException { Document doc = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); doc = builder.parse(file); } catch (SAXException e) { throw new DocumentManipulatorException(e); } catch (IOException e) { throw new DocumentManipulatorException(e); } catch (ParserConfigurationException e) { throw new DocumentManipulatorException(e); } return doc; } DocumentManipulator(); NodeList getNodeList(Document doc, String expression); void serializeDocumentToHtml(Document document, File outputFile, File xslFile); void serializeDocumentToXml(Document document, File outputFile); String serializeDocumentToString(Document document);  }### Answer:
@Test(expected = DocumentManipulatorException.class) public void testParseDocumentEmptyFile() throws DocumentManipulatorException { handler.parseDocument(new File("")); }
@Test public void testParseDocument() throws DocumentManipulatorException, URISyntaxException { URL url = this.getClass().getResource("/sample.xml"); Document doc = handler.parseDocument(new File(url.toURI())); assertNotNull("Document should not be null", doc); }