@Test
    public void testUnSubscribe2() {
        ConsumerConfig<Object> consumerConfig1 = new ConsumerConfig<>();
        String directUrl = "bolt://alipay.com";
        consumerConfig1.setDirectUrl(directUrl);

        ConsumerConfig<Object> consumerConfig2 = new ConsumerConfig<>();
        consumerConfig2.setDirectUrl(directUrl);

        domainRegistry.subscribe(consumerConfig1);
        domainRegistry.subscribe(consumerConfig2);

        assertTrue(domainRegistry.notifyListeners.containsKey(directUrl));
        assertTrue(domainRegistry.notifyListeners.get(directUrl).contains(consumerConfig1));
        assertTrue(domainRegistry.notifyListeners.get(directUrl).contains(consumerConfig2));
        assertEquals(2, domainRegistry.notifyListeners.get(directUrl).size());

        domainRegistry.unSubscribe(consumerConfig1);
        assertTrue(domainRegistry.notifyListeners.containsKey(directUrl));
        assertEquals(1, domainRegistry.notifyListeners.get(directUrl).size());

        domainRegistry.unSubscribe(consumerConfig2);
        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