Buggy code:
interface HostControllerExecutionSupport { ModelNode getDomainOperation ( ) { } Map < ServerIdentity , ModelNode > getServerOps ( HostControllerExecutionSupport . ServerOperationProvider provider ) { } ModelNode getFormattedDomainResult ( ModelNode resultNode ) ; interface ServerOperationProvider { Map < Set < ServerIdentity > , ModelNode > getServerOperations ( ModelNode domainOp , PathAddress address ) { } } interface DomainModelProvider { ModelNode getDomainModel ( ) { } } class Factory { public static HostControllerExecutionSupport create ( final ModelNode operation , final String hostName , final HostControllerExecutionSupport . DomainModelProvider domainModelProvider , final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry ) { } private static class IgnoredOpExecutionSupport extends HostControllerExecutionSupport . Factory . SimpleOpExecutionSupport { private IgnoredOpExecutionSupport ( ) { } @ Override public ModelNode getDomainOperation ( ) { } @ Override public Map < ServerIdentity , ModelNode > getServerOps ( HostControllerExecutionSupport . ServerOperationProvider provider ) { } } private static class DirectServerOpExecutionSupport extends HostControllerExecutionSupport . Factory . SimpleOpExecutionSupport { private Map < ServerIdentity , ModelNode > serverOps ; private DirectServerOpExecutionSupport ( final ServerIdentity serverIdentity , ModelNode serverOp ) { } @ Override public ModelNode getDomainOperation ( ) { } @ Override public Map < ServerIdentity , ModelNode > getServerOps ( HostControllerExecutionSupport . ServerOperationProvider provider ) { } } private static class DomainOpExecutionSupport extends HostControllerExecutionSupport . Factory . SimpleOpExecutionSupport { private final ModelNode domainOp ; private final PathAddress domainOpAddress ; private DomainOpExecutionSupport ( ModelNode domainOp , final PathAddress domainOpAddress ) { } @ Override public ModelNode getDomainOperation ( ) { } @ Override public Map < ServerIdentity , ModelNode > getServerOps ( HostControllerExecutionSupport . ServerOperationProvider provider ) { } } private abstract static class SimpleOpExecutionSupport implements HostControllerExecutionSupport { private SimpleOpExecutionSupport ( ) { } @ Override public ModelNode getFormattedDomainResult ( ModelNode resultNode ) { <START_BUG> return resultNode ; <END_BUG> } } private static class MultiStepOpExecutionSupport implements HostControllerExecutionSupport { private final List < HostControllerExecutionSupport > steps ; private MultiStepOpExecutionSupport ( final List < HostControllerExecutionSupport > steps ) { } public Map < ServerIdentity , ModelNode > getServerOps ( HostControllerExecutionSupport . ServerOperationProvider provider ) { } @ Override public ModelNode getDomainOperation ( ) { } @ Override public ModelNode getFormattedDomainResult ( ModelNode resultNode ) { ModelNode allSteps = new ModelNode ( ) ; int resultStep = 0 ; for ( int i = 0 ; i < ( steps . size ( ) ) ; i ++ ) { HostControllerExecutionSupport po = steps . get ( i ) ; if ( ( po . getDomainOperation ( ) ) != null ) { String label = "step-" + ( ++ resultStep ) ; ModelNode stepResultNode = resultNode . get ( label ) ; ModelNode formattedStepResultNode = po . getFormattedDomainResult ( stepResultNode ) ; allSteps . get ( ( "step-" + ( i + 1 ) ) ) . set ( formattedStepResultNode ) ; } else { allSteps . get ( ( "step-" + ( i + 1 ) ) , OUTCOME ) . set ( IGNORED ) ; } } return allSteps ; } } } }

Fix:
return resultNode . clone ( ) ;