@Test public void testFilter() { final DescriptiveUrlBag list = new DescriptiveUrlBag(); final DescriptiveUrl url = new DescriptiveUrl(URI.create("http: list.add(url); assertTrue(list.filter(DescriptiveUrl.Type.provider).isEmpty()); assertTrue(list.filter(DescriptiveUrl.Type.cdn).isEmpty()); assertFalse(list.filter(DescriptiveUrl.Type.http).isEmpty()); assertFalse(list.filter(DescriptiveUrl.Type.provider, DescriptiveUrl.Type.http).isEmpty()); assertEquals(DescriptiveUrl.EMPTY, list.find(DescriptiveUrl.Type.provider)); assertEquals(url, list.find(DescriptiveUrl.Type.http)); }
public DescriptiveUrlBag filter(final DescriptiveUrl.Type... types) { final DescriptiveUrlBag filtered = new DescriptiveUrlBag(this); filtered.removeIf(url -> !Arrays.asList(types).contains(url.getType())); return filtered; }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrlBag filter(final DescriptiveUrl.Type... types) { final DescriptiveUrlBag filtered = new DescriptiveUrlBag(this); filtered.removeIf(url -> !Arrays.asList(types).contains(url.getType())); return filtered; } }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrlBag filter(final DescriptiveUrl.Type... types) { final DescriptiveUrlBag filtered = new DescriptiveUrlBag(this); filtered.removeIf(url -> !Arrays.asList(types).contains(url.getType())); return filtered; } DescriptiveUrlBag();  DescriptiveUrlBag(final java.util.Collection<? extends DescriptiveUrl> c); }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrlBag filter(final DescriptiveUrl.Type... types) { final DescriptiveUrlBag filtered = new DescriptiveUrlBag(this); filtered.removeIf(url -> !Arrays.asList(types).contains(url.getType())); return filtered; } DescriptiveUrlBag();  DescriptiveUrlBag(final java.util.Collection<? extends DescriptiveUrl> c); static DescriptiveUrlBag empty(); @Override boolean add(final DescriptiveUrl url); DescriptiveUrlBag filter(final DescriptiveUrl.Type... types); DescriptiveUrl find(DescriptiveUrl.Type type); }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrlBag filter(final DescriptiveUrl.Type... types) { final DescriptiveUrlBag filtered = new DescriptiveUrlBag(this); filtered.removeIf(url -> !Arrays.asList(types).contains(url.getType())); return filtered; } DescriptiveUrlBag();  DescriptiveUrlBag(final java.util.Collection<? extends DescriptiveUrl> c); static DescriptiveUrlBag empty(); @Override boolean add(final DescriptiveUrl url); DescriptiveUrlBag filter(final DescriptiveUrl.Type... types); DescriptiveUrl find(DescriptiveUrl.Type type);  }