MulticastRegistry extends FailbackRegistry { @Override public void subscribe(URL url, NotifyListener listener) { super.subscribe(url, listener); subscribed(url, listener); } MulticastRegistry(URL url); @Override boolean isAvailable(); @Override void destroy(); @Override void register(URL url); @Override void unregister(URL url); @Override void subscribe(URL url, NotifyListener listener); @Override void unsubscribe(URL url, NotifyListener listener); @Override List<URL> lookup(URL url); MulticastSocket getMutilcastSocket(); Map<URL, Set<URL>> getReceived();  }
@Test public void testSubscribe() { final AtomicReference<URL> args = new AtomicReference<URL>(); registry.subscribe(consumerUrl, new NotifyListener() { @Override public void notify(List<URL> urls) { args.set(urls.get(0)); } }); assertEquals(serviceUrl.toFullString(), args.get().toFullString()); Map<URL, Set<NotifyListener>> arg = registry.getSubscribed(); assertEquals(consumerUrl, arg.keySet().iterator().next()); }