Source:
public void testCompatibleScreens ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String higherPriority = "" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<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" ) + " <compatible-screens>\n" ) + " <!-- all small size screens -->\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"ldpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"mdpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"xhdpi\" />\n" ) + " <!-- all normal size screens -->\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"ldpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"hdpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"xhdpi\" />\n" ) + " </compatible-screens>" ) + "\n" ) + "</manifest>" ) ; java.lang.String lowerPriorityOne = "" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib1\">\n" ) + "\n" ) + " <compatible-screens>\n" ) + " <!-- all small size screens -->\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"ldpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"mdpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"hdpi\" />\n" ) + " <!-- all normal size screens -->\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"mdpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"hdpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"xhdpi\" />\n" ) + " </compatible-screens>" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument refDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "higherPriority" ) , higherPriority ) ; com.android.manifmerger.XmlDocument firstLibrary = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "lowerPriorityOne" ) , lowerPriorityOne ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( new com.android.utils.StdLogger ( StdLogger.Level.VERBOSE ) ) ; com.google.common.base.Optional < com.android.manifmerger.XmlDocument > result = refDocument.merge ( firstLibrary , mergingReportBuilder ) ; assertTrue ( result.isPresent ( ) ) ; com.google.common.collect.ImmutableList < com.android.manifmerger.XmlElement > mergeableElements = result.get ( ) . getRootNode ( ) . getMergeableElements ( ) ; assertEquals ( 1 , mergeableElements.size ( ) ) ; com.google.common.collect.ImmutableList < com.android.manifmerger.XmlElement > mergedScreens = mergeableElements.get ( 0 ) . getMergeableElements ( ) ; assertEquals ( 8 , mergedScreens.size ( ) ) ; }

Target:
public void testCompatibleScreens ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String higherPriority = "" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<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" ) + " <compatible-screens>\n" ) + " <!-- all small size screens -->\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"ldpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"mdpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"xhdpi\" />\n" ) + " <!-- all normal size screens -->\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"ldpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"hdpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"xhdpi\" />\n" ) + " </compatible-screens>" ) + "\n" ) + "</manifest>" ) ; java.lang.String lowerPriorityOne = "" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib1\">\n" ) + "\n" ) + " <compatible-screens>\n" ) + " <!-- all small size screens -->\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"ldpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"mdpi\" />\n" ) + " <screen android:screenSize=\"small\" android:screenDensity=\"hdpi\" />\n" ) + " <!-- all normal size screens -->\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"mdpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"hdpi\" />\n" ) + " <screen android:screenSize=\"normal\" android:screenDensity=\"xhdpi\" />\n" ) + " </compatible-screens>" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument refDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "higherPriority" ) , higherPriority ) ; com.android.manifmerger.XmlDocument firstLibrary = com.android.manifmerger.TestUtils.xmlLibraryFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "lowerPriorityOne" ) , lowerPriorityOne ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( new com.android.utils.StdLogger ( StdLogger.Level.VERBOSE ) ) ; com.google.common.base.Optional < com.android.manifmerger.XmlDocument > result = refDocument.merge ( firstLibrary , mergingReportBuilder ) ; assertTrue ( result.isPresent ( ) ) ; com.google.common.collect.ImmutableList < com.android.manifmerger.XmlElement > mergeableElements = result.get ( ) . getRootNode ( ) . getMergeableElements ( ) ; assertEquals ( 1 , mergeableElements.size ( ) ) ; com.google.common.collect.ImmutableList < com.android.manifmerger.XmlElement > mergedScreens = mergeableElements.get ( 0 ) . getMergeableElements ( ) ; assertEquals ( 8 , mergedScreens.size ( ) ) ; }