### Question:
AbstractRegistry implements Registry { @Override public void unregister(URL url) { if (url == null) { throw new IllegalArgumentException("unregister url == null"); } if (logger.isInfoEnabled()) { logger.info("Unregister: " + url); } registered.remove(url); } AbstractRegistry(URL url); @Override URL getUrl(); Set<URL> getRegistered(); Map<URL, Set<NotifyListener>> getSubscribed(); Map<URL, Map<String, List<URL>>> getNotified(); File getCacheFile(); Properties getCacheProperties(); AtomicLong getLastCacheChanged(); void doSaveProperties(long version); List<URL> getCacheUrls(URL url); @Override List<URL> lookup(URL url); @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 void destroy(); @Override String toString();  }### Answer:
@Test public void testUnregister() throws Exception { URL url = new URL("dubbo", "192.168.0.1", 2200); abstractRegistry.getRegistered().add(url); abstractRegistry.unregister(url); MatcherAssert.assertThat(false, Matchers.equalTo(abstractRegistry.getRegistered().contains(url))); abstractRegistry.getRegistered().clear(); List<URL> urlList = getList(); for (URL urlSub : urlList) { abstractRegistry.getRegistered().add(urlSub); } for (URL urlSub : urlList) { abstractRegistry.unregister(urlSub); } MatcherAssert.assertThat(0, Matchers.equalTo(abstractRegistry.getRegistered().size())); }