@Test
public void test() throws Exception {

    RegistryServiceListener listener1 = Mockito.mock(RegistryServiceListener.class);
    RegistryServiceListener1.delegate = listener1;
    RegistryServiceListener listener2 = Mockito.mock(RegistryServiceListener.class);
    RegistryServiceListener2.delegate = listener2;
    Registry registry = registryFactory.getRegistry(URL.valueOf("simple://localhost:8080/registry-service"));
    URL url = URL.valueOf("dubbo://localhost:8081/simple.service");
    registry.register(url);
    Mockito.verify(listener1, Mockito.times(1)).onRegister(url);
    Mockito.verify(listener2, Mockito.times(1)).onRegister(url);
    registry.unregister(url);
    Mockito.verify(listener1, Mockito.times(1)).onUnregister(url);
    Mockito.verify(listener2, Mockito.times(1)).onUnregister(url);
    registry.subscribe(url, Mockito.mock(NotifyListener.class));
    Mockito.verify(listener1, Mockito.times(1)).onSubscribe(url);
    Mockito.verify(listener2, Mockito.times(1)).onSubscribe(url);
    registry.unsubscribe(url, Mockito.mock(NotifyListener.class));
    Mockito.verify(listener1, Mockito.times(1)).onUnsubscribe(url);
    Mockito.verify(listener2, Mockito.times(1)).onUnsubscribe(url);
}