@Test
    public void testUnSubscribe() {
        ConsumerConfig<Object> consumerConfig = new ConsumerConfig<>();
        String directUrl = "bolt://alipay.com";
        consumerConfig.setDirectUrl(directUrl);
        List<ProviderGroup> providerGroups = domainRegistry.subscribe(consumerConfig);
        assertTrue(domainRegistry.notifyListeners.containsKey(directUrl));
        assertSame(consumerConfig, domainRegistry.notifyListeners.get(directUrl).get(0));
        assertEquals(1, domainRegistry.notifyListeners.get(directUrl).size());

        domainRegistry.unSubscribe(consumerConfig);
        assertTrue(domainRegistry.notifyListeners.containsKey(directUrl));
        assertEquals(0, domainRegistry.notifyListeners.get(directUrl).size());
    }
@author <a href=mailto:orezsilence@163.com>zhangchengxi</a>
registry/registry-local/src/test/java/com/alipay/sofa/rpc/registry/local/DomainRegistryTest.java