AbstractRegistryFactory implements RegistryFactory { public static Registry getRegistry(String key) { return REGISTRIES.get(key); }  static Collection<Registry> getRegistries(); static Registry getRegistry(String key); static List<ServiceDiscovery> getServiceDiscoveries(); static void destroyAll(); @Override Registry getRegistry(URL url); static void removeDestroyedRegistry(Registry toRm); static void clearRegistryNotDestroy();  }
@Test public void testRegistryFactoryCache() throws Exception { URL url = URL.valueOf("dubbo: Registry registry1 = registryFactory.getRegistry(url); Registry registry2 = registryFactory.getRegistry(url); Assertions.assertEquals(registry1, registry2); }
@Test public void testRegistryFactoryGroupCache() throws Exception { Registry registry1 = registryFactory.getRegistry(URL.valueOf("dubbo: Registry registry2 = registryFactory.getRegistry(URL.valueOf("dubbo: Assertions.assertNotSame(registry1, registry2); }