Thread.sleep(TIMEOUT);
services = _collection.getAllServices();
assertEquals(1, services.size());
SimpleFederatedService service = (SimpleFederatedService) _collection.getServiceForAgencyId("A");
assertEquals("A", service.getValueForId(""));
_registry.addService("http://localhost:" + PORT + "/service-B/service",
SimpleFederatedService.class.getName(), new HashMap<String, String>());
Thread.sleep(TIMEOUT);
services = _collection.getAllServices();
assertEquals(2, services.size());
service = (SimpleFederatedService) _collection.getServiceForAgencyId("A");
assertEquals("A", service.getValueForId(""));
service = (SimpleFederatedService) _collection.getServiceForAgencyId("B");
assertEquals("B", service.getValueForId(""));
// Simulate a server crash
_server.stop();
_server = null;