VastXmlManager { void parseVastXml(String xmlString) throws ParserConfigurationException, IOException, SAXException { xmlString = xmlString.replaceFirst("<\\?.*\\?>", ""); String documentString = ROOT_TAG_OPEN + xmlString + ROOT_TAG_CLOSE; DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setCoalescing(true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); mVastDoc = documentBuilder.parse(new InputSource(new StringReader(documentString))); }    }
@Test public void parseVastXml_shouldNotRaiseAnExceptionProcessingXmlWithXmlHeaderTag() throws ParserConfigurationException, IOException, SAXException { String xmlString = XML_HEADER_TAG + TEST_VAST_XML_STRING; mXmlManager = new VastXmlManager(); mXmlManager.parseVastXml(xmlString); }