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 ) { } private static ModelNode trimUndefinedChildren ( ModelNode model ) { } private static String getCompareStackAsString ( Stack < String > stack ) { } public static void checkModelAgainstDefinition ( final ModelNode model , ManagementResourceRegistration rr ) { } private static void checkModelAgainstDefinition ( final ModelNode model , ManagementResourceRegistration rr , Stack < PathElement > stack ) { } private static String getComparePathAsString ( Stack < PathElement > stack ) { } public static void checkFailedTransformedBootOperations ( ModelTestKernelServices < ? > mainServices , ModelVersion modelVersion , List < ModelNode > operations , FailedOperationTransformationConfig config ) throws OperationFailedException { for ( ModelNode op : operations ) { ModelTestUtils . checkOutcome ( mainServices . executeOperation ( op ) ) ; ModelTestUtils . checkFailedTransformedAddOperation ( mainServices , modelVersion , op . clone ( ) , config ) ; List < ModelNode > writeOps = config . createWriteAttributeOperations ( op ) ; for ( ModelNode writeOp : writeOps ) { <START_BUG> TransformedOperation transformedOperation = mainServices . transformOperation ( modelVersion , writeOp ) ; <END_BUG> ModelNode result = mainServices . executeOperation ( modelVersion , transformedOperation ) ; if ( ! ( config . expectFailedWriteAttributeOperation ( writeOp ) ) ) { Assert . assertEquals ( ( ( ( "Failed:<seq2seq4repair_space>" + writeOp ) + "\n" ) + result ) , SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; } else { Assert . assertEquals ( ( "Expected<seq2seq4repair_space>failure:<seq2seq4repair_space>" + writeOp ) , FAILED , result . get ( OUTCOME ) . asString ( ) ) ; transformedOperation = mainServices . transformOperation ( modelVersion , config . correctWriteAttributeOperation ( writeOp ) ) ; result = mainServices . executeOperation ( modelVersion , transformedOperation ) ; Assert . assertEquals ( ( ( ( result . get ( FAILURE_DESCRIPTION ) . asString ( ) ) + "<seq2seq4repair_space>for\n:" ) + ( transformedOperation . getTransformedOperation ( ) ) ) , SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; } } } } private static void checkFailedTransformedAddOperation ( ModelTestKernelServices < ? > mainServices , ModelVersion modelVersion , ModelNode operation , FailedOperationTransformationConfig config ) throws OperationFailedException { } }

Fix:
TransformedOperation transformedOperation = mainServices . transformOperation ( modelVersion , writeOp . clone ( ) ) ;