Buggy code:
public class ServerControllerUnitTestCase { private final ServiceContainer container = Factory . create ( ) ; private ModelController controller ; @ Before public void beforeClass ( ) throws Exception { } @ After public void afterClass ( ) { } @ Test public void testInterfacesAlternatives ( ) throws IOException { } @ Test public void testUpdateInterface ( ) throws IOException { } @ Test public void testComplexInterface ( ) throws IOException { } protected void populateCritieria ( final ModelNode model , final ServerControllerUnitTestCase . Nesting nesting , final AttributeDefinition ... excluded ) { } private static class ModelControllerService extends AbstractControllerService { final CountDownLatch latch = new CountDownLatch ( 1 ) ; final ServerControllerUnitTestCase . StringConfigurationPersister persister ; final ControlledProcessState processState ; final ServerControllerUnitTestCase . DelegatingResourceDefinition rootResourceDefinition ; final ServerEnvironment environment ; final ExtensionRegistry extensionRegistry ; volatile ManagementResourceRegistration rootRegistration ; volatile Exception error ; ModelControllerService ( final ControlledProcessState processState , final ServerControllerUnitTestCase . StringConfigurationPersister persister , final ServerControllerUnitTestCase . DelegatingResourceDefinition rootResourceDefinition ) { } @ Override protected void initModel ( Resource rootResource , ManagementResourceRegistration rootRegistration ) { } @ Override protected boolean boot ( List < ModelNode > bootOperations , boolean rollbackOnRuntimeFailure ) throws ConfigurationPersistenceException { } @ Override public void start ( StartContext context ) throws StartException { <START_BUG> rootResourceDefinition . setDelegate ( new org . jboss . as . server . controller . resources . ServerRootResourceDefinition ( ServerControllerUnitTestCase . MockRepository . INSTANCE , persister , environment , processState , null , null , extensionRegistry , false , ServerControllerUnitTestCase . MOCK_PATH_MANAGER , null ) ) ; <END_BUG> super . start ( context ) ; } } private static class DelegatingResourceDefinition implements ResourceDefinition { private volatile ResourceDefinition delegate ; void setDelegate ( ResourceDefinition delegate ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerChildren ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } @ Override public PathElement getPathElement ( ) { } @ Override public DescriptionProvider getDescriptionProvider ( ImmutableManagementResourceRegistration resourceRegistration ) { } } static class StringConfigurationPersister extends AbstractConfigurationPersister { private final List < ModelNode > bootOperations ; volatile String marshalled ; public StringConfigurationPersister ( List < ModelNode > bootOperations , XMLElementWriter < ModelMarshallingContext > rootDeparser ) { } @ Override public PersistenceResource store ( ModelNode model , Set < PathAddress > affectedAddresses ) throws ConfigurationPersistenceException { } @ Override public List < ModelNode > load ( ) throws ConfigurationPersistenceException { } private class StringPersistenceResource implements PersistenceResource { private byte [ ] bytes ; private final AbstractConfigurationPersister persister ; StringPersistenceResource ( final ModelNode model , final AbstractConfigurationPersister persister ) throws ConfigurationPersistenceException { } @ Override public void commit ( ) { } @ Override public void rollback ( ) { } } } static ModelNode readResource ( final ModelControllerClient client , final ModelNode address ) { } static void executeForFailure ( final ModelControllerClient client , final ModelNode operation ) { } static ModelNode executeForResult ( final ModelControllerClient client , final ModelNode operation ) { } static final class MockRepository implements ContentRepository , DeploymentFileRepository { static ServerControllerUnitTestCase . MockRepository INSTANCE = new ServerControllerUnitTestCase . MockRepository ( ) ; @ Override public File [ ] getDeploymentFiles ( byte [ ] deploymentHash ) { } @ Override public File getDeploymentRoot ( byte [ ] deploymentHash ) { } @ Override public void deleteDeployment ( byte [ ] deploymentHash ) { } @ Override public byte [ ] addContent ( InputStream stream ) throws IOException { } @ Override public boolean syncContent ( byte [ ] hash ) { } @ Override public VirtualFile getContent ( byte [ ] hash ) { } @ Override public boolean hasContent ( byte [ ] hash ) { } @ Override public void removeContent ( byte [ ] hash , Object reference ) { } @ Override public void addContentReference ( byte [ ] hash , Object reference ) { } } private static PathManagerService MOCK_PATH_MANAGER = new PathManagerService ( ) { } ; private enum Nesting { TOP , ANY , NOT ; } }

Fix:
rootResourceDefinition . setDelegate ( new org . jboss . as . server . controller . resources . ServerRootResourceDefinition ( ServerControllerUnitTestCase . MockRepository . INSTANCE , persister , environment , processState , null , null , extensionRegistry , false , ServerControllerUnitTestCase . MOCK_PATH_MANAGER , null , authorizer ) ) ;