Source:
public void testInvalidOrder_withComments ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String input = "" + ( ( ( ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <activity android:name=\"activityOne\"/>" ) + "\n" ) + " <!-- with comments ! -->" ) + " <application android:label=\"@string/lib_name\" />\n" ) + "\n" ) + " <uses-sdk minSdkVersion=\"14\"/>" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testInvalidOrder" ) , input ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( mILogger ) ; com.android.manifmerger.PostValidator.validate ( xmlDocument , mergingReportBuilder ) ; java.lang.System.out.println ( xmlDocument.prettyPrint ( ) ) ; org.w3c.dom.Node lastChild = xmlDocument.getRootNode ( ) . getXml ( ) . getLastChild ( ) ; while ( ( lastChild.getNodeType ( ) ) != ( org.w3c.dom.Node.ELEMENT_NODE ) ) { lastChild = lastChild.getPreviousSibling ( ) ; } com.android.manifmerger.OrphanXmlElement xmlElement = new com.android.manifmerger.OrphanXmlElement ( ( ( org.w3c.dom.Element ) ( lastChild ) ) ) ; assertEquals ( ManifestModel.NodeTypes.APPLICATION , xmlElement.getType ( ) ) ; assertEquals ( org.w3c.dom.Node.COMMENT_NODE , lastChild.getPreviousSibling ( ) . getNodeType ( ) ) ; }

Target:
public void testApplicationInvalidOrder_withComments ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String input = "" + ( ( ( ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <activity android:name=\"activityOne\"/>" ) + "\n" ) + " <!-- with comments ! -->" ) + " <application android:label=\"@string/lib_name\" />\n" ) + "\n" ) + " <uses-sdk minSdkVersion=\"14\"/>" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testApplicationInvalidOrder" ) , input ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( mILogger ) ; com.android.manifmerger.PostValidator.validate ( xmlDocument , mergingReportBuilder ) ; java.lang.System.out.println ( xmlDocument.prettyPrint ( ) ) ; org.w3c.dom.Node lastChild = xmlDocument.getRootNode ( ) . getXml ( ) . getLastChild ( ) ; while ( ( lastChild.getNodeType ( ) ) != ( org.w3c.dom.Node.ELEMENT_NODE ) ) { lastChild = lastChild.getPreviousSibling ( ) ; } com.android.manifmerger.OrphanXmlElement xmlElement = new com.android.manifmerger.OrphanXmlElement ( ( ( org.w3c.dom.Element ) ( lastChild ) ) ) ; assertEquals ( ManifestModel.NodeTypes.APPLICATION , xmlElement.getType ( ) ) ; assertEquals ( org.w3c.dom.Node.COMMENT_NODE , lastChild.getPreviousSibling ( ) . getNodeType ( ) ) ; }