};
}
public void testAddRemove() throws Exception {
BasicServiceRegistryEntry ref1 = new StaticServiceRegistryEntry("service1", "beanName1", "module", null, Collections.singletonMap("mapkey", "bean1"), ClassUtils.getDefaultClassLoader());
BasicServiceRegistryEntry ref2 = new StaticServiceRegistryEntry("service2", "beanName2", "module", null, Collections.singletonMap("mapkey", "bean2"), ClassUtils.getDefaultClassLoader());
assertTrue(map.add(ref1));
assertTrue(map.add(ref2));
assertTrue(map.add(ref1));
assertTrue(map.add(ref2));
assertEquals(2, map.size());
assertEquals("service1", map.get("bean1"));
assertEquals("service2", map.get("bean2"));
BasicServiceRegistryEntry refWithNoMapKey = new StaticServiceRegistryEntry("service2", "beanName2", "module", null, null, ClassUtils.getDefaultClassLoader());
assertFalse(map.add(refWithNoMapKey));
assertEquals(2, map.size());
assertTrue(map.remove(ref1));