### Question:
XMLReader { @SuppressWarnings("unchecked") public List<Node> getElementList( String xpathExpr ) throws XMLException { XPathExpression xpath = null; try { xpath = createXPath( xpathExpr ); Object evaluated = xpath.evaluate( document, XPathConstants.NODESET); if ( evaluated == null ) { return Collections.emptyList(); } NodeList nl = (NodeList) evaluated; List<Node> nodeList = new ArrayList<>(); for (int i = 0 ; i<nl.getLength(); i++) { nodeList.add(nl.item(i)); } return nodeList; } catch (XPathExpressionException e) { throw new XMLException("Could not parse xpath expression"); } } XMLReader( String type, Path file );  XMLReader( String type, StorageAsset asset);  XMLReader( String type, URL url ); String getDefaultNamespaceURI(); void addNamespaceMapping( String elementName, String uri ); Element getElement( String xpathExpr ); boolean hasElement( String xpathExpr ); void removeNamespaces(); @SuppressWarnings("unchecked") void removeNamespaces( Node elem ); String getElementText( Node context, String xpathExpr ); String getElementText( String xpathExpr ); @SuppressWarnings("unchecked") List<Node> getElementList( String xpathExpr ); List<String> getElementListText( String xpathExpr );  }### Answer:
@Test public void testNoPrologBasicRead() throws XMLException { Path xmlFile = getExampleXml( "no-prolog-basic.xml" ); XMLReader reader = new XMLReader( "basic", xmlFile ); List<Node> fruits = reader.getElementList( " assertElementTexts( fruits, new String[] { "apple", "cherry", "pear", "peach" } ); }
@Test public void testNoPrologEntitiesRead() throws XMLException { Path xmlFile = getExampleXml( "no-prolog-with-entities.xml" ); XMLReader reader = new XMLReader( "basic", xmlFile ); List<Node> names = reader.getElementList( " assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } ); }
@Test public void testNoPrologUtf8Read() throws XMLException { Path xmlFile = getExampleXml( "no-prolog-with-utf8.xml" ); XMLReader reader = new XMLReader( "basic", xmlFile ); List<Node> names = reader.getElementList( " assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } ); }
@Test public void testPrologUtf8Read() throws XMLException { Path xmlFile = getExampleXml( "prolog-with-utf8.xml" ); XMLReader reader = new XMLReader( "basic", xmlFile ); List<Node> names = reader.getElementList( " assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } ); }