Source:
public void testAttributeInstructions ( ) 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\" " ) + " tools:remove=\"android:theme\"/>\n" ) + "\n" ) + " <activity android:name=\"activityTwo\" " ) + " android:theme=\"@theme1\"\n" ) + " tools:replace=\"android:theme\"/>\n" ) + "\n" ) + " <activity android:name=\"activityThree\" " ) + " tools:strict=\"android:exported\"/>\n" ) + "\n" ) + " <activity android:name=\"activityFour\" " ) + " android:theme=\"@theme1\"\n" ) + " android:exported=\"true\"\n" ) + " android:windowSoftInputMode=\"stateUnchanged\"\n" ) + " tools:replace=" ) + "\"android:theme, android:exported,android:windowSoftInputMode\"/>\n" ) + "\n" ) + " <activity android:name=\"activityFive\" " ) + " android:theme=\"@theme1\"\n" ) + " android:exported=\"true\"\n" ) + " android:windowSoftInputMode=\"stateUnchanged\"\n" ) + " tools:remove=\"android:exported\"\n" ) + " tools:replace=\"android:theme\"\n" ) + " tools:strict=\"android:windowSoftInputMode\"/>\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testAttributeInstructions()" ) , input ) ; com.google.common.base.Optional < com.android.manifmerger.XmlElement > activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; com.android.manifmerger.XmlElement activity = activityOptional.get ( ) ; assertEquals ( 1 , activity.getAttributeOperations ( ) . size ( ) ) ; com.android.manifmerger.AttributeOperationType attributeOperationType = activity.getAttributeOperationType ( "android:theme" ) ; assertEquals ( AttributeOperationType.REMOVE , attributeOperationType ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityTwo" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 1 , activity.getAttributeOperations ( ) . size ( ) ) ; attributeOperationType = activity.getAttributeOperationType ( "android:theme" ) ; assertEquals ( AttributeOperationType.REPLACE , attributeOperationType ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityThree" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 1 , activity.getAttributeOperations ( ) . size ( ) ) ; attributeOperationType = activity.getAttributeOperationType ( "android:exported" ) ; assertEquals ( AttributeOperationType.STRICT , attributeOperationType ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityFour" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 3 , activity.getAttributeOperations ( ) . size ( ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( "android:theme" ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( "android:exported" ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( "android:windowSoftInputMode" ) ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityFive" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 3 , activity.getAttributeOperations ( ) . size ( ) ) ; assertEquals ( AttributeOperationType.REMOVE , activity.getAttributeOperationType ( "android:exported" ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( "android:theme" ) ) ; assertEquals ( AttributeOperationType.STRICT , activity.getAttributeOperationType ( "android:windowSoftInputMode" ) ) ; }

Target:
public void testAttributeInstructions ( ) 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\" " ) + " tools:remove=\"android:theme\"/>\n" ) + "\n" ) + " <activity android:name=\"activityTwo\" " ) + " android:theme=\"@theme1\"\n" ) + " tools:replace=\"android:theme\"/>\n" ) + "\n" ) + " <activity android:name=\"activityThree\" " ) + " tools:strict=\"android:exported\"/>\n" ) + "\n" ) + " <activity android:name=\"activityFour\" " ) + " android:theme=\"@theme1\"\n" ) + " android:exported=\"true\"\n" ) + " android:windowSoftInputMode=\"stateUnchanged\"\n" ) + " tools:replace=" ) + "\"android:theme, android:exported,android:windowSoftInputMode\"/>\n" ) + "\n" ) + " <activity android:name=\"activityFive\" " ) + " android:theme=\"@theme1\"\n" ) + " android:exported=\"true\"\n" ) + " android:windowSoftInputMode=\"stateUnchanged\"\n" ) + " tools:remove=\"android:exported\"\n" ) + " tools:replace=\"android:theme\"\n" ) + " tools:strict=\"android:windowSoftInputMode\"/>\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testAttributeInstructions()" ) , input ) ; com.google.common.base.Optional < com.android.manifmerger.XmlElement > activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; com.android.manifmerger.XmlElement activity = activityOptional.get ( ) ; assertEquals ( 1 , activity.getAttributeOperations ( ) . size ( ) ) ; com.android.manifmerger.AttributeOperationType attributeOperationType = activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ; assertEquals ( AttributeOperationType.REMOVE , attributeOperationType ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityTwo" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 1 , activity.getAttributeOperations ( ) . size ( ) ) ; attributeOperationType = activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ; assertEquals ( AttributeOperationType.REPLACE , attributeOperationType ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityThree" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 1 , activity.getAttributeOperations ( ) . size ( ) ) ; attributeOperationType = activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ; assertEquals ( AttributeOperationType.STRICT , attributeOperationType ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityFour" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 3 , activity.getAttributeOperations ( ) . size ( ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ) ; activityOptional = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityFive" ) ; assertTrue ( activityOptional.isPresent ( ) ) ; activity = activityOptional.get ( ) ; assertEquals ( 3 , activity.getAttributeOperations ( ) . size ( ) ) ; assertEquals ( AttributeOperationType.REMOVE , activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:exported" ) ) ) ; assertEquals ( AttributeOperationType.REPLACE , activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:theme" ) ) ) ; assertEquals ( AttributeOperationType.STRICT , activity.getAttributeOperationType ( com.android.manifmerger.XmlNode.fromXmlName ( "android:windowSoftInputMode" ) ) ) ; }