Buggy code:
private class KernelServicesBuilderImpl implements ModelTestBootOperationsBuilder . BootOperationParser , KernelServicesBuilder { private final ModelTestBootOperationsBuilder bootOperationBuilder ; private final AdditionalInitialization additionalInit ; private Map < ModelVersion , SubsystemTestDelegate . LegacyKernelServiceInitializerImpl > legacyControllerInitializers = new HashMap < ModelVersion , SubsystemTestDelegate . LegacyKernelServiceInitializerImpl > ( ) ; public KernelServicesBuilderImpl ( AdditionalInitialization additionalInit ) { } @ Override public KernelServicesBuilder setSubsystemXmlResource ( String resource ) throws IOException , XMLStreamException { } @ Override public KernelServicesBuilder setSubsystemXml ( String subsystemXml ) throws XMLStreamException { } public KernelServicesBuilder setBootOperations ( List < ModelNode > bootOperations ) { } @ Override public KernelServicesBuilder setBootOperations ( ModelNode ... bootOperations ) { } public LegacyKernelServicesInitializer createLegacyKernelServicesBuilder ( AdditionalInitialization additionalInit , ModelTestControllerVersion version , ModelVersion modelVersion ) { } public KernelServices build ( ) throws Exception { } @ Override public List < ModelNode > parse ( String subsystemXml ) throws XMLStreamException { } @ Override public List < ModelNode > parseXml ( String xml ) throws Exception { } @ Override public List < ModelNode > parseXmlResource ( String xmlResource ) throws Exception { } } private class LegacyKernelServiceInitializerImpl implements LegacyKernelServicesInitializer { private final AdditionalInitialization additionalInit ; private final ModelTestControllerVersion testControllerVersion ; private String extensionClassName ; private ModelVersion modelVersion ; private ChildFirstClassLoaderBuilder classLoaderBuilder ; private Builder operationValidationExcludeBuilder ; private boolean persistXml = true ; private boolean skipReverseCheck ; private AdditionalInitialization reverseCheckConfig ; private ModelFixer reverseCheckModelFixer ; private OperationFixer reverseCheckOperationFixer = new OperationFixer ( ) { @ Override public ModelNode fixOperation ( ModelNode operation ) { } } ; public LegacyKernelServiceInitializerImpl ( AdditionalInitialization additionalInit , ModelTestControllerVersion version , ModelVersion modelVersion ) { } @ Override public LegacyKernelServicesInitializer addOperationValidationExclude ( String name , PathAddress pathAddress ) { } @ Override public LegacyKernelServicesInitializer addOperationValidationResolve ( String name , PathAddress pathAddress ) { } private void addOperationValidationConfig ( String name , PathAddress pathAddress , Action action ) { } @ Override public LegacyKernelServicesInitializer setExtensionClassName ( String extensionClassName ) { } @ Override public LegacyKernelServicesInitializer addURL ( URL url ) { } @ Override public LegacyKernelServicesInitializer addSimpleResourceURL ( String resource ) throws MalformedURLException { } @ Override public LegacyKernelServicesInitializer addMavenResourceURL ( String artifactGav ) throws IOException , ClassNotFoundException { } @ Override public SubsystemTestDelegate . LegacyKernelServiceInitializerImpl addParentFirstClassPattern ( String pattern ) { } @ Override public SubsystemTestDelegate . LegacyKernelServiceInitializerImpl addChildFirstClassPattern ( String pattern ) { } @ Override public LegacyKernelServicesInitializer excludeFromParent ( ClassFilter exclusionFilter ) { } @ Override public LegacyKernelServicesInitializer addSingleChildFirstClass ( Class < ? > ... classes ) { } private LegacyControllerKernelServicesProxy install ( KernelServices mainServices , List < ModelNode > bootOperations ) throws Exception { } @ Override public LegacyKernelServicesInitializer dontPersistXml ( ) { } @ Override public LegacyKernelServicesInitializer skipReverseControllerCheck ( ) { } @ Override public LegacyKernelServicesInitializer configureReverseControllerCheck ( AdditionalInitialization additionalInit , ModelFixer modelFixer ) { } @ Override public LegacyKernelServicesInitializer configureReverseControllerCheck ( AdditionalInitialization additionalInit , ModelFixer modelFixer , OperationFixer fixer ) { } private KernelServices bootCurrentVersionWithLegacyBootOperations ( List < ModelNode > bootOperations , KernelServices mainServices ) throws Exception { List < ModelNode > clonedBootOperations = new ArrayList < ModelNode > ( ) ; for ( ModelNode op : bootOperations ) { ModelNode cloned = reverseCheckOperationFixer . fixOperation ( op . clone ( ) ) ; if ( cloned != null ) { clonedBootOperations . add ( cloned ) ; } } KernelServices reverseServices = createKernelServicesBuilder ( reverseCheckConfig ) . setBootOperations ( clonedBootOperations ) . build ( ) ; if ( ( reverseServices . getBootError ( ) ) != null ) { Throwable t = reverseServices . getBootError ( ) ; if ( t instanceof Exception ) { throw ( ( Exception ) ( t ) ) ; } throw new Exception ( t ) ; } Assert . assertTrue ( reverseServices . isSuccessfulBoot ( ) ) ; ModelNode reverseSubsystem = reverseServices . readWholeModel ( ) . get ( SUBSYSTEM , getMainSubsystemName ( ) ) ; if ( ( reverseCheckModelFixer ) != null ) { <START_BUG> reverseCheckModelFixer . fixModel ( reverseSubsystem ) ; <END_BUG> } ModelTestUtils . compare ( mainServices . readWholeModel ( ) . get ( SUBSYSTEM , getMainSubsystemName ( ) ) , reverseSubsystem ) ; return reverseServices ; } private ModelTestOperationValidatorFilter getOperationValidationFilter ( ) { } } @ SuppressWarnings ( "deprecation" ) private final ManagementResourceRegistration MOCK_RESOURCE_REG = new ManagementResourceRegistration ( ) { @ Override public boolean isRuntimeOnly ( ) { } @ Override public boolean isRemote ( ) { } @ Override public OperationEntry getOperationEntry ( PathAddress address , String operationName ) { } @ Override public OperationStepHandler getOperationHandler ( PathAddress address , String operationName ) { } @ Override public DescriptionProvider getOperationDescription ( PathAddress address , String operationName ) { } @ Override public Set < Flag > getOperationFlags ( PathAddress address , String operationName ) { } @ Override public Set < String > getAttributeNames ( PathAddress address ) { } @ Override public AttributeAccess getAttributeAccess ( PathAddress address , String attributeName ) { } @ Override public Set < String > getChildNames ( PathAddress address ) { } @ Override public Set < PathElement > getChildAddresses ( PathAddress address ) { } @ Override public DescriptionProvider getModelDescription ( PathAddress address ) { } @ Override public Map < String , OperationEntry > getOperationDescriptions ( PathAddress address , boolean inherited ) { } @ Override public ProxyController getProxyController ( PathAddress address ) { } @ Override public Set < ProxyController > getProxyControllers ( PathAddress address ) { } @ Override public ManagementResourceRegistration getOverrideModel ( String name ) { } @ Override public ManagementResourceRegistration getSubModel ( PathAddress address ) { } @ Override public List < AccessConstraintDefinition > getAccessConstraints ( ) { } @ Override public ManagementResourceRegistration registerSubModel ( PathElement address , DescriptionProvider descriptionProvider ) { } @ Override public ManagementResourceRegistration registerSubModel ( ResourceDefinition resourceDefinition ) { } @ Override public void unregisterSubModel ( PathElement address ) { } @ Override public boolean isAllowsOverride ( ) { } @ Override public void setRuntimeOnly ( boolean runtimeOnly ) { } @ Override public ManagementResourceRegistration registerOverrideModel ( String name , OverrideDescriptionProvider descriptionProvider ) { }

Fix:
reverseSubsystem = reverseCheckModelFixer . fixModel ( reverseSubsystem ) ;