Source:
public void testMultipleElements_withRejection ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String other = "" + ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/apk/res/android/tools\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <activity android:name=\"activityOne\"" ) + " android:configChanges=\"locale\"/>\n" ) + " <application android:name=\"applicationOne\"/>" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , com.android.manifmerger.ActionRecorderTest.REFEFENCE_DOCUMENT ) , com.android.manifmerger.ActionRecorderTest.REFERENCE ) ; com.android.manifmerger.XmlDocument otherDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "other_document" ) , other ) ; com.android.manifmerger.XmlElement activityElement = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ; mActionRecorderBuilder.recordNodeAction ( activityElement , ActionRecorder.ActionType.ADDED ) ; mActionRecorderBuilder.recordNodeAction ( activityElement , ActionRecorder.ActionType.REJECTED , otherDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ) ; com.android.manifmerger.XmlElement applicationElement = otherDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.APPLICATION , null ) . get ( ) ; mActionRecorderBuilder.recordNodeAction ( applicationElement , ActionRecorder.ActionType.ADDED ) ; com.android.manifmerger.ActionRecorder actionRecorder = mActionRecorderBuilder.build ( ) ; com.google.common.collect.ImmutableMap < java.lang.String , com.android.manifmerger.ActionRecorder.DecisionTreeRecord > allRecords = actionRecorder.getAllRecords ( ) ; assertEquals ( 2 , allRecords.size ( ) ) ; assertEquals ( 2 , allRecords.get ( activityElement.getId ( ) ) . getNodeRecords ( ) . size ( ) ) ; assertEquals ( ActionRecorder.ActionType.ADDED , allRecords.get ( activityElement.getId ( ) ) . getNodeRecords ( ) . get ( 0 ) . mActionType ) ; assertEquals ( ActionRecorder.ActionType.REJECTED , allRecords.get ( activityElement.getId ( ) ) . getNodeRecords ( ) . get ( 1 ) . mActionType ) ; assertEquals ( 0 , allRecords.get ( activityElement.getId ( ) ) . getAttributesRecords ( ) . size ( ) ) ; assertEquals ( 1 , allRecords.get ( applicationElement.getId ( ) ) . getNodeRecords ( ) . size ( ) ) ; assertEquals ( 0 , allRecords.get ( applicationElement.getId ( ) ) . getAttributesRecords ( ) . size ( ) ) ; actionRecorder.log ( mLoggerMock ) ; java.lang.StringBuilder stringBuilder = new java.lang.StringBuilder ( ) ; stringBuilder.append ( ActionRecorder.HEADER ) . append ( activityElement.getId ( ) ) . append ( "\n" ) ; appendNode ( stringBuilder , ActionRecorder.ActionType.ADDED , com.android.manifmerger.ActionRecorderTest.REFEFENCE_DOCUMENT , 6 ) ; appendNode ( stringBuilder , ActionRecorder.ActionType.REJECTED , "other_document" , 6 ) ; stringBuilder.append ( applicationElement.getId ( ) ) . append ( "\n" ) ; appendNode ( stringBuilder , ActionRecorder.ActionType.ADDED , "other_document" , 7 ) ; org.mockito.Mockito.verify ( mLoggerMock ) . info ( stringBuilder.toString ( ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mLoggerMock ) ; }

Target:
public void testMultipleElements_withRejection ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String other = "" + ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/apk/res/android/tools\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <activity android:name=\"activityOne\"" ) + " android:configChanges=\"locale\"/>\n" ) + " <application android:name=\"applicationOne\"/>" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument xmlDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , com.android.manifmerger.ActionRecorderTest.REFEFENCE_DOCUMENT ) , com.android.manifmerger.ActionRecorderTest.REFERENCE ) ; com.android.manifmerger.XmlDocument otherDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "other_document" ) , other ) ; com.android.manifmerger.XmlElement activityElement = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ; mActionRecorderBuilder.recordNodeAction ( activityElement , Actions.ActionType.ADDED ) ; mActionRecorderBuilder.recordNodeAction ( activityElement , Actions.ActionType.REJECTED , otherDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ) ; com.android.manifmerger.XmlElement applicationElement = otherDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.APPLICATION , null ) . get ( ) ; mActionRecorderBuilder.recordNodeAction ( applicationElement , Actions.ActionType.ADDED ) ; com.android.manifmerger.Actions actions = mActionRecorderBuilder.build ( ) ; assertEquals ( 2 , actions.getNodeKeys ( ) . size ( ) ) ; assertEquals ( 2 , actions.getNodeRecords ( activityElement.getId ( ) ) . size ( ) ) ; assertEquals ( Actions.ActionType.ADDED , actions.getNodeRecords ( activityElement.getId ( ) ) . get ( 0 ) . mActionType ) ; assertEquals ( Actions.ActionType.REJECTED , actions.getNodeRecords ( activityElement.getId ( ) ) . get ( 1 ) . mActionType ) ; assertEquals ( 0 , actions.getRecordedAttributeNames ( activityElement.getId ( ) ) . size ( ) ) ; assertEquals ( 1 , actions.getNodeRecords ( applicationElement.getId ( ) ) . size ( ) ) ; assertEquals ( 0 , actions.getRecordedAttributeNames ( applicationElement.getId ( ) ) . size ( ) ) ; actions.log ( mLoggerMock ) ; java.lang.StringBuilder stringBuilder = new java.lang.StringBuilder ( ) ; stringBuilder.append ( Actions.HEADER ) . append ( activityElement.getId ( ) ) . append ( "\n" ) ; appendNode ( stringBuilder , Actions.ActionType.ADDED , com.android.manifmerger.ActionRecorderTest.REFEFENCE_DOCUMENT , 6 ) ; appendNode ( stringBuilder , Actions.ActionType.REJECTED , "other_document" , 6 ) ; stringBuilder.append ( applicationElement.getId ( ) ) . append ( "\n" ) ; appendNode ( stringBuilder , Actions.ActionType.ADDED , "other_document" , 7 ) ; org.mockito.Mockito.verify ( mLoggerMock ) . info ( stringBuilder.toString ( ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mLoggerMock ) ; }