@Test public void testFind() { final DescriptiveUrlBag list = new DescriptiveUrlBag(); final DescriptiveUrl url = new DescriptiveUrl(URI.create("http: list.add(url); assertEquals(DescriptiveUrl.EMPTY, list.find(DescriptiveUrl.Type.provider)); assertEquals(url, list.find(DescriptiveUrl.Type.http)); }
public DescriptiveUrl find(DescriptiveUrl.Type type) { for(DescriptiveUrl url : this) { if(url.getType().equals(type)) { return url; } } return DescriptiveUrl.EMPTY; }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrl find(DescriptiveUrl.Type type) { for(DescriptiveUrl url : this) { if(url.getType().equals(type)) { return url; } } return DescriptiveUrl.EMPTY; } }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrl find(DescriptiveUrl.Type type) { for(DescriptiveUrl url : this) { if(url.getType().equals(type)) { return url; } } return DescriptiveUrl.EMPTY; } DescriptiveUrlBag();  DescriptiveUrlBag(final java.util.Collection<? extends DescriptiveUrl> c); }
DescriptiveUrlBag extends LinkedHashSet<DescriptiveUrl> { public DescriptiveUrl find(DescriptiveUrl.Type type) { for(DescriptiveUrl url : this) { if(url.getType().equals(type)) { return url; } } return DescriptiveUrl.EMPTY; } 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 DescriptiveUrl find(DescriptiveUrl.Type type) { for(DescriptiveUrl url : this) { if(url.getType().equals(type)) { return url; } } return DescriptiveUrl.EMPTY; } 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);  }