Source:
public void testSingleElement_withoutAttributes_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" ) + "\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 xmlElement = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ; mActionRecorderBuilder.recordNodeAction ( xmlElement , ActionRecorder.ActionType.ADDED ) ; mActionRecorderBuilder.recordNodeAction ( xmlElement , ActionRecorder.ActionType.REJECTED , otherDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ) ; com.android.manifmerger.ActionRecorder actionRecorder = mActionRecorderBuilder.build ( ) ; com.google.common.collect.ImmutableMap < java.lang.String , com.android.manifmerger.ActionRecorder.DecisionTreeRecord > allRecords = actionRecorder.getAllRecords ( ) ; assertEquals ( 1 , allRecords.size ( ) ) ; assertEquals ( 2 , allRecords.get ( xmlElement.getId ( ) ) . getNodeRecords ( ) . size ( ) ) ; assertEquals ( ActionRecorder.ActionType.ADDED , allRecords.get ( xmlElement.getId ( ) ) . getNodeRecords ( ) . get ( 0 ) . mActionType ) ; assertEquals ( ActionRecorder.ActionType.REJECTED , allRecords.get ( xmlElement.getId ( ) ) . getNodeRecords ( ) . get ( 1 ) . mActionType ) ; assertEquals ( 0 , allRecords.get ( xmlElement.getId ( ) ) . getAttributesRecords ( ) . size ( ) ) ; actionRecorder.log ( mLoggerMock ) ; java.lang.StringBuilder stringBuilder = new java.lang.StringBuilder ( ) ; stringBuilder.append ( ActionRecorder.HEADER ) . append ( xmlElement.getId ( ) ) . append ( "\n" ) ; appendNode ( stringBuilder , ActionRecorder.ActionType.ADDED , com.android.manifmerger.ActionRecorderTest.REFEFENCE_DOCUMENT , 6 ) ; appendNode ( stringBuilder , ActionRecorder.ActionType.REJECTED , "other_document" , 6 ) ; org.mockito.Mockito.verify ( mLoggerMock ) . info ( stringBuilder.toString ( ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mLoggerMock ) ; }

Target:
public void testSingleElement_withoutAttributes_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" ) + "\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 xmlElement = xmlDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ; mActionRecorderBuilder.recordNodeAction ( xmlElement , Actions.ActionType.ADDED ) ; mActionRecorderBuilder.recordNodeAction ( xmlElement , Actions.ActionType.REJECTED , otherDocument.getRootNode ( ) . getNodeByTypeAndKey ( ManifestModel.NodeTypes.ACTIVITY , "com.example.lib3.activityOne" ) . get ( ) ) ; com.android.manifmerger.Actions actions = mActionRecorderBuilder.build ( ) ; assertEquals ( 1 , actions.getNodeKeys ( ) . size ( ) ) ; assertEquals ( 2 , actions.getNodeRecords ( xmlElement.getId ( ) ) . size ( ) ) ; assertEquals ( Actions.ActionType.ADDED , actions.getNodeRecords ( xmlElement.getId ( ) ) . get ( 0 ) . mActionType ) ; assertEquals ( Actions.ActionType.REJECTED , actions.getNodeRecords ( xmlElement.getId ( ) ) . get ( 1 ) . mActionType ) ; assertEquals ( 0 , actions.getRecordedAttributeNames ( xmlElement.getId ( ) ) . size ( ) ) ; actions.log ( mLoggerMock ) ; java.lang.StringBuilder stringBuilder = new java.lang.StringBuilder ( ) ; stringBuilder.append ( Actions.HEADER ) . append ( xmlElement.getId ( ) ) . append ( "\n" ) ; appendNode ( stringBuilder , Actions.ActionType.ADDED , com.android.manifmerger.ActionRecorderTest.REFEFENCE_DOCUMENT , 6 ) ; appendNode ( stringBuilder , Actions.ActionType.REJECTED , "other_document" , 6 ) ; org.mockito.Mockito.verify ( mLoggerMock ) . info ( stringBuilder.toString ( ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mLoggerMock ) ; }