Source:
public void testSimpleMerge ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String main = "" + ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <application android:label=\"@string/lib_name\" />\n" ) + "\n" ) + "</manifest>" ) ; java.lang.String library = "" + ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <activity android:name=\"activityOne\" />\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument mainDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testSimpleMerge()" ) , main ) ; com.android.manifmerger.XmlDocument libraryDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testSimpleMerge()" ) , library ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( mLogger ) ; com.google.common.base.Optional < com.android.manifmerger.XmlDocument > mergedDocument = mainDocument.merge ( libraryDocument , mergingReportBuilder ) ; assertTrue ( mergedDocument.isPresent ( ) ) ; java.io.ByteArrayOutputStream byteArrayOutputStream = new java.io.ByteArrayOutputStream ( ) ; mergedDocument.get ( ) . write ( byteArrayOutputStream ) ; java.util.logging.Logger.getAnonymousLogger ( ) . info ( byteArrayOutputStream.toString ( ) ) ; assertTrue ( mergedDocument.get ( ) . getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.APPLICATION , null ) . isPresent ( ) ) ; com.google.common.base.Optional < com.android.manifmerger.XmlElement > activityOne = mergedDocument.get ( ) . getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) ; assertTrue ( activityOne.isPresent ( ) ) ; }

Target:
public void testSimpleMerge ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String main = "" + ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <application android:label=\"@string/lib_name\" />\n" ) + "\n" ) + "</manifest>" ) ; java.lang.String library = "" + ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <activity android:name=\"activityOne\" />\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument mainDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testSimpleMerge()" ) , main ) ; com.android.manifmerger.XmlDocument libraryDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testSimpleMerge()" ) , library ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( mLogger ) ; com.google.common.base.Optional < com.android.manifmerger.XmlDocument > mergedDocument = mainDocument.merge ( libraryDocument , mergingReportBuilder ) ; assertTrue ( mergedDocument.isPresent ( ) ) ; java.util.logging.Logger.getAnonymousLogger ( ) . info ( mergedDocument.get ( ) . prettyPrint ( ) ) ; assertTrue ( mergedDocument.get ( ) . getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.APPLICATION , null ) . isPresent ( ) ) ; com.google.common.base.Optional < com.android.manifmerger.XmlElement > activityOne = mergedDocument.get ( ) . getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) ; assertTrue ( activityOne.isPresent ( ) ) ; }