### Question:
ServerActivator implements EventListener<ServerConfigEvent> { public void activateServers(Object object) { for (ServerSourceController controller : myServerSourceManager.getControllers()) { if (controller instanceof StateServerSourceController) { StateServerSourceController stateController = (StateServerSourceController)controller; ServerSourceProvider serverSource = stateController.getStateServerProvider(); List<IDataSource> servers = Collections.emptyList(); if (object instanceof Node) { servers = serverSource.getServersInNode((Node)object); } else if (object instanceof StateType) { servers = serverSource.getServersInNode((StateType)object); } if (!servers.isEmpty()) { ServerSourceFilterer filterer = stateController.getServerSourceFilterer(); filterer.findBusyServers(myActivationListener, servers); List<IDataSource> nonActiveServers = filterer.getNonActiveServers(servers); List<IDataSource> nonAddedServers = filterer.getNonAddedServers(servers); addThenActivate(controller, nonAddedServers, nonActiveServers); } } } } ServerActivator(ServerSourceControllerManager serverSourceManager, EventManager eventManager,
            IActivationListener activationListener); void activateServers(Object object); void close(); @Override void notify(ServerConfigEvent event);  }### Answer:
@Test public void testActivateServers() throws XPathExpressionException, ParserConfigurationException, JAXBException { myIsWfsActivated = false; myIsWmsActivated = false; Node stateNode = StateNodeUtils.createWfsNodeWithData(ourWfsServer); ServerSourceProvider provider = ServerActivatorUtils.createSourceProvider(stateNode); ServerSourceFilterer filterer = ServerActivatorUtils.createSourceFilterer(); ServerSourceController controller = ServerActivatorUtils.createServerController(provider, filterer, new IAnswer<Void>() { @Override public Void answer() { IDataSource source = (IDataSource)EasyMock.getCurrentArguments()[0]; if (source.getName().equals("wfsHost")) { myIsWfsActivated = true; } else if (source.getName().equals("somehost")) { myIsWmsActivated = true; } return null; } }); ServerSourceControllerManager controllerManager = ServerActivatorUtils.createControllerManager(controller); EventManager eventManager = createEventManager(); IActivationListener activationListener = createListener(); EasyMock.replay(provider, filterer, controller, controllerManager, eventManager, activationListener); ServerActivator activator = new ServerActivator(controllerManager, eventManager, activationListener); activator.activateServers(stateNode); EasyMock.verify(provider, filterer, controller, controllerManager, eventManager, activationListener); assertTrue(myIsWfsActivated); assertTrue(myIsWmsActivated); }