Source:
public void testAttributeRemoval ( ) 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" ) + " <activity android:name=\"activityOne\"\n" ) + " tools:remove=\"theme\"/>\n" ) + "\n" ) + "</manifest>" ) ; java.lang.String lowerPriority = "" + ( ( ( ( ( ( ( ( "<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" ) + " android:theme=\"@oldtheme\"/>\n" ) + "\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 otherDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "lowerPriority" ) , lowerPriority ) ; 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 ( otherDocument , mergingReportBuilder ) ; assertTrue ( result.isPresent ( ) ) ; com.android.manifmerger.XmlDocument resultDocument = result.get ( ) ; com.google.common.base.Optional < com.android.manifmerger.XmlElement > activityOne = resultDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) ; assertTrue ( activityOne.isPresent ( ) ) ; java.util.List < com.android.manifmerger.XmlAttribute > attributes = activityOne.get ( ) . getAttributes ( ) ; assertEquals ( 2 , attributes.size ( ) ) ; assertTrue ( activityOne.get ( ) . getAttribute ( com.android.manifmerger.XmlNode.fromXmlName ( "android:name" ) ) . isPresent ( ) ) ; assertTrue ( activityOne.get ( ) . getAttribute ( com.android.manifmerger.XmlNode.fromNSName ( SdkConstants.TOOLS_URI , "tools" , "remove" ) ) . isPresent ( ) ) ; com.android.manifmerger.Actions actions = mergingReportBuilder.getActionRecorder ( ) . build ( ) ; java.util.List < com.android.manifmerger.Actions.AttributeRecord > attributeRecords = actions.getAttributeRecords ( activityOne.get ( ) . getId ( ) , com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ; assertNotNull ( attributeRecords ) ; assertEquals ( 1 , attributeRecords.size ( ) ) ; com.android.manifmerger.Actions.AttributeRecord attributeRecord = attributeRecords.get ( 0 ) ; assertEquals ( Actions.ActionType.REJECTED , attributeRecord.getActionType ( ) ) ; assertEquals ( AttributeOperationType.REMOVE , attributeRecord.getOperationType ( ) ) ; assertEquals ( 7 , attributeRecord.getActionLocation ( ) . getPosition ( ) . getLine ( ) ) ; }

Target:
public void testAttributeRemoval ( ) 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" ) + " <activity android:name=\"activityOne\"\n" ) + " tools:remove=\"theme\"/>\n" ) + "\n" ) + "</manifest>" ) ; java.lang.String lowerPriority = "" + ( ( ( ( ( ( ( ( "<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" ) + " android:theme=\"@oldtheme\"/>\n" ) + "\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 otherDocument = com.android.manifmerger.TestUtils.xmlLibraryFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "lowerPriority" ) , lowerPriority ) ; 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 ( otherDocument , mergingReportBuilder ) ; assertTrue ( result.isPresent ( ) ) ; com.android.manifmerger.XmlDocument resultDocument = result.get ( ) ; com.google.common.base.Optional < com.android.manifmerger.XmlElement > activityOne = resultDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) ; assertTrue ( activityOne.isPresent ( ) ) ; java.util.List < com.android.manifmerger.XmlAttribute > attributes = activityOne.get ( ) . getAttributes ( ) ; assertEquals ( 2 , attributes.size ( ) ) ; assertTrue ( activityOne.get ( ) . getAttribute ( com.android.manifmerger.XmlNode.fromXmlName ( "android:name" ) ) . isPresent ( ) ) ; assertTrue ( activityOne.get ( ) . getAttribute ( com.android.manifmerger.XmlNode.fromNSName ( SdkConstants.TOOLS_URI , "tools" , "remove" ) ) . isPresent ( ) ) ; com.android.manifmerger.Actions actions = mergingReportBuilder.getActionRecorder ( ) . build ( ) ; java.util.List < com.android.manifmerger.Actions.AttributeRecord > attributeRecords = actions.getAttributeRecords ( activityOne.get ( ) . getId ( ) , com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ; assertNotNull ( attributeRecords ) ; assertEquals ( 1 , attributeRecords.size ( ) ) ; com.android.manifmerger.Actions.AttributeRecord attributeRecord = attributeRecords.get ( 0 ) ; assertEquals ( Actions.ActionType.REJECTED , attributeRecord.getActionType ( ) ) ; assertEquals ( AttributeOperationType.REMOVE , attributeRecord.getOperationType ( ) ) ; assertEquals ( 7 , attributeRecord.getActionLocation ( ) . getPosition ( ) . getLine ( ) ) ; }