### Question:
MulticastRegistry extends FailbackRegistry { @Override public void unsubscribe(URL url, NotifyListener listener) { super.unsubscribe(url, listener); received.remove(url); } MulticastRegistry(URL url); @Override void doRegister(URL url); @Override void doUnregister(URL url); @Override void doSubscribe(URL url, NotifyListener listener); @Override void doUnsubscribe(URL url, NotifyListener listener); @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 getMulticastSocket(); Map<URL, Set<URL>> getReceived();  }### Answer:
@Test public void testUnsubscribe() { registry.subscribe(consumerUrl, new NotifyListener() { @Override public void notify(List<URL> urls) { } }); registry.unsubscribe(consumerUrl, new NotifyListener() { @Override public void notify(List<URL> urls) { Map<URL, Set<NotifyListener>> subscribed = registry.getSubscribed(); Set<NotifyListener> listeners = subscribed.get(consumerUrl); assertTrue(listeners.isEmpty()); Map<URL, Set<URL>> received = registry.getReceived(); assertTrue(received.get(consumerUrl).isEmpty()); } }); }