// with toLowerCase
ServiceInfo[] services = registry.list(service.getType().toLowerCase());
assertEquals("We should see the service we just registered: ", 1, services.length);
assertEquals(service, services[0]);
// now unregister and make sure it's gone
registry.unregisterService(services[0]);
// According to the spec the record disappears from the cache 1s after it has been unregistered
// without sleeping for a while, the service would not be unregistered fully
Thread.sleep(1500);
services = registry.list(service.getType().toLowerCase());
assertTrue("We should not see the service we just unregistered: ", services == null || services.length == 0);