Buggy code:
public class ApplyRemoteMasterDomainModelHandlerTestCase extends AbstractOperationTestCase { private final ExtensionRegistry extensionRegistry = new ExtensionRegistry ( ProcessType . HOST_CONTROLLER , new org . jboss . as . controller . RunningModeControl ( RunningMode . NORMAL ) ) ; private final ApplyExtensionsHandler extensionHandler = new ApplyExtensionsHandler ( extensionRegistry , HOST_INFO , new IgnoredDomainResourceRegistry ( HOST_INFO ) ) { @ Override protected void initializeExtension ( String module ) { } } ; WritableAuthorizerConfiguration authorizerConfiguration = new WritableAuthorizerConfiguration ( StandardRBACAuthorizer . AUTHORIZER_DESCRIPTION ) ; private final ApplyRemoteMasterDomainModelHandler handler = new ApplyRemoteMasterDomainModelHandler ( new ApplyRemoteMasterDomainModelHandlerTestCase . MockDomainController ( ) , ApplyRemoteMasterDomainModelHandlerTestCase . createHostControllerEnvironment ( ) , null , null , HOST_INFO , new IgnoredDomainResourceRegistry ( HOST_INFO ) , authorizerConfiguration ) ; @ Test public void testNoChanges ( ) throws Exception { } @ Test public void testBooting ( ) throws Exception { } @ Test public void testRootResource ( ) throws Exception { } @ Test public void testExtensionAdd ( ) throws Exception { } @ Test public void testExtensionRemove ( ) throws Exception { } @ Test public void testChangesToNonExtensions ( ) throws Exception { } @ Test public void testDifferentOrderNoChange ( ) throws Exception { } @ Test public void testRolloutPlans ( ) throws Exception { } private ModelNode getCurrentModelUpdates ( Resource root , ApplyRemoteMasterDomainModelHandlerTestCase . UpdateListModifier modifier ) throws Exception { } private MockOperationContext getOperationContext ( Resource root , boolean booting ) { } private static class UpdateListModifier { private ModelNode [ ] additions ; private Map < PathAddress , ModelNode > changes ; private Set < PathAddress > removals ; public UpdateListModifier ( ModelNode [ ] additions , Map < PathAddress , ModelNode > changes , Set < PathAddress > removals ) { } static ApplyRemoteMasterDomainModelHandlerTestCase . UpdateListModifier createForAdditions ( ModelNode ... additions ) { } static ApplyRemoteMasterDomainModelHandlerTestCase . UpdateListModifier createForChanges ( ModelNode ... changes ) { } static ApplyRemoteMasterDomainModelHandlerTestCase . UpdateListModifier createForRemovals ( PathAddress ... removals ) { } ModelNode modifyList ( ModelNode existing ) { } } private static class MockDomainController implements DomainController { @ Override public RunningMode getCurrentRunningMode ( ) { } @ Override public LocalHostControllerInfo getLocalHostInfo ( ) { } @ Override public void registerRemoteHost ( String hostName , ManagementChannelHandler handler , Transformers transformers , Long remoteConnectionId , DomainControllerRuntimeIgnoreTransformationEntry runtimeIgnoreTransformation , boolean registerProxyController ) throws SlaveRegistrationException { } @ Override public boolean isHostRegistered ( String id ) { } @ Override <START_BUG> public void unregisterRemoteHost ( String id , Long remoteConnectionId , boolean cleanShutdown ) { <END_BUG> } @ Override public void pingRemoteHost ( String hostName ) { } @ Override public void registerRunningServer ( ProxyController serverControllerClient ) { } @ Override public void unregisterRunningServer ( String serverName ) { } @ Override public ModelNode getProfileOperations ( String profileName ) { } @ Override public HostFileRepository getLocalFileRepository ( ) { } @ Override public HostFileRepository getRemoteFileRepository ( ) { } @ Override public void stopLocalHost ( ) { } @ Override public void stopLocalHost ( int exitCode ) { } @ Override public ExtensionRegistry getExtensionRegistry ( ) { } @ Override public ExpressionResolver getExpressionResolver ( ) { } @ Override public void initializeMasterDomainRegistry ( ManagementResourceRegistration root , ExtensibleConfigurationPersister configurationPersister , ContentRepository contentRepository , HostFileRepository fileRepository , ExtensionRegistry extensionRegistry , PathManagerService pathManager ) { } @ Override public void initializeSlaveDomainRegistry ( ManagementResourceRegistration root , ExtensibleConfigurationPersister configurationPersister , ContentRepository contentRepository , HostFileRepository fileRepository , LocalHostControllerInfo hostControllerInfo , ExtensionRegistry extensionRegistry , IgnoredDomainResourceRegistry ignoredDomainResourceRegistry , PathManagerService pathManager ) { } } private static class NoopTransformers implements Transformers { @ Override public TransformationTarget getTarget ( ) { } @ Override public TransformedOperation transformOperation ( TransformationContext context , ModelNode operation ) throws OperationFailedException { } @ Override public TransformedOperation transformOperation ( OperationContext operationContext , ModelNode operation ) throws OperationFailedException { } @ Override public Resource transformResource ( ResourceTransformationContext context , Resource resource ) throws OperationFailedException { } @ Override public Resource transformRootResource ( OperationContext operationContext , Resource resource ) throws OperationFailedException { } @ Override public Resource transformResource ( OperationContext operationContext , PathAddress original , Resource resource , boolean skipRuntimeIgnoreCheck ) throws OperationFailedException { } } private static HostControllerEnvironment createHostControllerEnvironment ( ) { } private static void delete ( File file ) { } }

Fix:
public void unregisterRemoteHost ( String id , Long remoteConnectionId ) {