Source:
public void testUsesFeatureSplit_attributeDeleted ( ) 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" ) + " <uses-feature android:name=\"@string/lib_name\"" ) + " android:required=\"false\"" ) + " android:glEsVersion=\"0x00020000\"/>\n" ) + " <uses-feature" ) + " android:required=\"false\"" ) + " android:glEsVersion=\"0x00030000\"/>\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testUsesFeatureSplit" ) , input ) ; com.android.manifmerger.ActionRecorder.Builder mockActionRecorder = org.mockito.Mockito.mock ( ActionRecorder.Builder.class ) ; com.android.manifmerger.MergingReport.Builder mockReport = org.mockito.Mockito.mock ( MergingReport.Builder.class ) ; org.mockito.Mockito.when ( mockReport.getActionRecorder ( ) ) . thenReturn ( mockActionRecorder ) ; com.android.manifmerger.ElementsTrimmer.trim ( xmlDocument , mockReport ) ; org.w3c.dom.NodeList elementsByTagName = xmlDocument.getRootNode ( ) . getXml ( ) . getElementsByTagName ( "uses-feature" ) ; assertEquals ( 2 , elementsByTagName.getLength ( ) ) ; org.mockito.Mockito.verify ( mockActionRecorder ) . recordAttributeAction ( org.mockito.Matchers.any ( com.android.manifmerger.XmlAttribute.class ) , org.mockito.Matchers.eq ( ActionRecorder.ActionType.REJECTED ) , ( ( com.android.manifmerger.AttributeOperationType ) ( org.mockito.Matchers.eq ( null ) ) ) ) ; for ( int i = 0 ; i < ( elementsByTagName.getLength ( ) ) ; i ++ ) { org.w3c.dom.NamedNodeMap attributes = elementsByTagName.item ( i ) . getAttributes ( ) ; assertEquals ( 2 , attributes.getLength ( ) ) ; ensureOnlyOneKey ( attributes , ManifestModel.NodeTypes.USES_FEATURE ) ; } }

Target:
public void testUsesFeatureSplit_attributeDeleted ( ) 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" ) + " <uses-feature android:name=\"@string/lib_name\"" ) + " android:required=\"false\"" ) + " android:glEsVersion=\"0x00020000\"/>\n" ) + " <uses-feature" ) + " android:required=\"false\"" ) + " android:glEsVersion=\"0x00030000\"/>\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testUsesFeatureSplit" ) , input ) ; com.android.manifmerger.ActionRecorder mockActionRecorder = org.mockito.Mockito.mock ( com.android.manifmerger.ActionRecorder.class ) ; com.android.manifmerger.MergingReport.Builder mockReport = org.mockito.Mockito.mock ( MergingReport.Builder.class ) ; org.mockito.Mockito.when ( mockReport.getActionRecorder ( ) ) . thenReturn ( mockActionRecorder ) ; com.android.manifmerger.ElementsTrimmer.trim ( xmlDocument , mockReport ) ; org.w3c.dom.NodeList elementsByTagName = xmlDocument.getRootNode ( ) . getXml ( ) . getElementsByTagName ( "uses-feature" ) ; assertEquals ( 2 , elementsByTagName.getLength ( ) ) ; org.mockito.Mockito.verify ( mockActionRecorder ) . recordAttributeAction ( org.mockito.Matchers.any ( com.android.manifmerger.XmlAttribute.class ) , org.mockito.Matchers.eq ( Actions.ActionType.REJECTED ) , ( ( com.android.manifmerger.AttributeOperationType ) ( org.mockito.Matchers.eq ( null ) ) ) ) ; for ( int i = 0 ; i < ( elementsByTagName.getLength ( ) ) ; i ++ ) { org.w3c.dom.NamedNodeMap attributes = elementsByTagName.item ( i ) . getAttributes ( ) ; assertEquals ( 2 , attributes.getLength ( ) ) ; ensureOnlyOneKey ( attributes , ManifestModel.NodeTypes.USES_FEATURE ) ; } }