}
public void testRegistry() throws Exception {
assertNull(registry.getService("notregistered", classes, false));
final ServiceRegistryEntry ref = registryaddService("bean1", "module1", "some service", classLoader);
assertEquals(1, entryDelegate.getBeanReferences("bean1").size());
assertEquals(1, entryDelegate.getModuleReferences("module1").size());
assertTrue(entryDelegate.getClassReferences(String.class).isEmpty());
assertTrue(entryDelegate.hasService(ref));
ServiceRegistryEntry service = registry.getService("bean1", classes, false);
assertEquals("some service", service.getServiceBeanReference().getService());
assertEquals("module1", service.getContributingModule());
registry.remove(ref);
assertNull(registry.getService("bean1", classes, false));
assertEquals(0, entryDelegate.getBeanReferences("bean1").size());
assertEquals(0, entryDelegate.getModuleReferences("module1").size());