### Question:
XmlParser extends BaseDocumentParser implements DocumentParser { @Override public Document parse(InputSource inputSource) throws ParserException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); try { docBuilderFactory.setNamespaceAware(true); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); return docBuilder.parse(inputSource); } catch (ParserConfigurationException e) { throw new ParserException(e); } catch (IOException e) { throw new ParserException(e); } catch (SAXException e) { throw new ParserException(e); } catch (ArrayIndexOutOfBoundsException e) { throw new ParserException(e); } catch (Throwable th) { throw new ParserException(th); } } protected  XmlParser(); @Override Document parse(InputSource inputSource); @Override Document parse(InputStream inputStream);  }### Answer:
@Test public void testParseInvalidXml() throws FileNotFoundException, ParserException { xmlParser.parse(ResourceHelper.getResourceFile("/xmlDocuments/invalid-chars.xml")); xmlParser.parse(ResourceHelper.getResourceFile("/feeds/sourceforge02.xml")); xmlParser.parse(ResourceHelper.getResourceFile("/feeds/feed061.xml")); }