Buggy code:
public class ModelTestUtils { private static final Pattern EXPRESSION_PATTERN = Pattern . compile ( ".*\\$\\{.*\\}.*" ) ; public static String readResource ( final Class < ? > clazz , final String name ) throws IOException { } public static ModelNode checkResultAndGetContents ( ModelNode result ) { } public static ModelNode checkOutcome ( ModelNode result ) { } public static ModelNode checkFailed ( ModelNode result ) { } public static void validateModelDescriptions ( PathAddress address , ImmutableManagementResourceRegistration reg ) { } public static void compare ( ModelNode node1 , ModelNode node2 ) { } public static void resolveAndCompareModels ( ModelNode node1 , ModelNode node2 ) { } public static void compare ( ModelNode node1 , ModelNode node2 , boolean ignoreUndefined ) { } public static String normalizeXML ( String xml ) throws Exception { } public static void compareXml ( final String original , final String marshalled ) throws Exception { } public static void compareXml ( final String original , final String marshalled , final boolean ignoreNamespace ) throws Exception { } public static ModelNode getSubModel ( ModelNode model , PathElement pathElement ) { } public static ModelNode getSubModel ( ModelNode model , PathAddress pathAddress ) { } public static void scanForExpressionFormattedStrings ( ModelNode model ) { } private static String removeNamespace ( String xml ) { } private static void compare ( ModelNode node1 , ModelNode node2 , boolean ignoreUndefined , boolean ignoreType , Stack < String > stack ) { if ( ! ignoreType ) { Assert . assertEquals ( ( ( ModelTestUtils . getCompareStackAsString ( stack ) ) + "<seq2seq4repair_space>types" ) , node1 . getType ( ) , node2 . getType ( ) ) ; } if ( ( node1 . getType ( ) ) == ( ModelType . OBJECT ) ) { ModelNode model1 = ( ignoreUndefined ) ? ModelTestUtils . trimUndefinedChildren ( node1 ) : node1 ; ModelNode model2 = ( ignoreUndefined ) ? ModelTestUtils . trimUndefinedChildren ( node2 ) : node2 ; final Set < String > keys1 = new TreeSet < String > ( model1 . keys ( ) ) ; final Set < String > keys2 = new TreeSet < String > ( model2 . keys ( ) ) ; if ( ! ( keys1 . toString ( ) . equals ( keys2 . toString ( ) ) ) ) { System . out . print ( "" ) ; } Assert . assertEquals ( ( ( ( ( ( ModelTestUtils . getCompareStackAsString ( stack ) ) + ":<seq2seq4repair_space>" ) + node1 ) + "\n" ) + node2 ) , keys1 . toString ( ) , keys2 . toString ( ) ) ; Assert . assertTrue ( keys1 . containsAll ( keys2 ) ) ; for ( String key : keys1 ) { final ModelNode child1 = model1 . get ( key ) ; Assert . assertTrue ( ( ( ( ( ( "Missing:<seq2seq4repair_space>" + key ) + "\n" ) + node1 ) + "\n" ) + node2 ) , model2 . has ( key ) ) ; final ModelNode child2 = model2 . get ( key ) ; if ( child1 . isDefined ( ) ) { if ( ! ignoreUndefined ) { Assert . assertTrue ( ( ( ( ( ( "key=" + key ) + "\n<seq2seq4repair_space>with<seq2seq4repair_space>child1<seq2seq4repair_space>\n" ) + ( child1 . toString ( ) ) ) + "\n<seq2seq4repair_space>has<seq2seq4repair_space>child2<seq2seq4repair_space>not<seq2seq4repair_space>defined\n<seq2seq4repair_space>node2<seq2seq4repair_space>is:\n" ) + ( node2 . toString ( ) ) ) , child2 . isDefined ( ) ) ; } stack . push ( ( key + "//" ) ) ; ModelTestUtils . compare ( child1 , child2 , ignoreUndefined , ignoreType , stack ) ; stack . pop ( ) ; } else if ( ! ignoreUndefined ) { <START_BUG> Assert . assertFalse ( child2 . asString ( ) , child2 . isDefined ( ) ) ; <END_BUG> } } } else if ( ( node1 . getType ( ) ) == ( ModelType . LIST ) ) { List < ModelNode > list1 = node1 . asList ( ) ; List < ModelNode > list2 = node2 . asList ( ) ; Assert . assertEquals ( ( ( list1 + "\n" ) + list2 ) , list1 . size ( ) , list2 . size ( ) ) ; for ( int i = 0 ; i < ( list1 . size ( ) ) ; i ++ ) { stack . push ( ( i + "//" ) ) ; ModelTestUtils . compare ( list1 . get ( i ) , list2 . get ( i ) , ignoreUndefined , ignoreType , stack ) ; stack . pop ( ) ; } } else if ( ( node1 . getType ( ) ) == ( ModelType . PROPERTY ) ) { Property prop1 = node1 . asProperty ( ) ; Property prop2 = node2 . asProperty ( ) ; Assert . assertEquals ( ( ( prop1 + "\n" ) + prop2 ) , prop1 . getName ( ) , prop2 . getName ( ) ) ; stack . push ( ( ( prop1 . getName ( ) ) + "//" ) ) ; ModelTestUtils . compare ( prop1 . getValue ( ) , prop2 . getValue ( ) , ignoreUndefined , ignoreType , stack ) ; stack . pop ( ) ; } else { try { Assert . assertEquals ( ( ( ( ( ( ( ModelTestUtils . getCompareStackAsString ( stack ) ) + "\n\"" ) + ( node1 . asString ( ) ) ) + "\"\n\"" ) + ( node2 . asString ( ) ) ) + "\"\n-----" ) , node2 . asString ( ) . trim ( ) , node1 . asString ( ) . trim ( ) ) ; } catch ( AssertionFailedError error ) { throw error ; } } } private static ModelNode trimUndefinedChildren ( ModelNode model ) { } private static String getCompareStackAsString ( Stack < String > stack ) { }

Fix:
Assert . assertFalse ( ( ( ( "key=" + key ) + "\n<seq2seq4repair_space>with<seq2seq4repair_space>child1<seq2seq4repair_space>undefined<seq2seq4repair_space>has<seq2seq4repair_space>child2<seq2seq4repair_space>\n" ) + ( child2 . asString ( ) ) ) , child2 . isDefined ( ) ) ;