### Question:
AbstractRegistry implements Registry { protected static List<URL> filterEmpty(URL url, List<URL> urls) { if (urls == null || urls.isEmpty()) { List<URL> result = new ArrayList<URL>(1); result.add(url.setProtocol(Constants.EMPTY_PROTOCOL)); return result; } return urls; } 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 filterEmptyTest() throws Exception { try { AbstractRegistry.filterEmpty(null, null); Assertions.fail(); } catch (Exception e) { Assertions.assertTrue(e instanceof NullPointerException); } List<URL> urls = new ArrayList<>(); try { AbstractRegistry.filterEmpty(null, urls); Assertions.fail(); } catch (Exception e) { Assertions.assertTrue(e instanceof NullPointerException); } urls.add(testUrl.setProtocol(Constants.EMPTY_PROTOCOL)); Assertions.assertEquals(AbstractRegistry.filterEmpty(testUrl, null), urls); List<URL> testUrls = new ArrayList<>(); Assertions.assertEquals(AbstractRegistry.filterEmpty(testUrl, testUrls), urls); testUrls.add(testUrl); Assertions.assertEquals(AbstractRegistry.filterEmpty(testUrl, testUrls), testUrls); }