ResourceSet extends LinkedList<Resource> { public ResourceSet filterByClassname(String className) { ResourceSet result = new ResourceSet(); for (Resource r : this) { if (r.getClassName().equals(className)) { result.add(r); } } return result; } ResourceSet(Collection<Resource> resources);  ResourceSet(); ResourceSet filterByNameRegex(String regex); ResourceSet filterByName(String name); ResourceSet filterByClassnameRegex(String regex); ResourceSet filterByClassname(String className); ResourceSet filterByNoteId(String noteId); ResourceSet filterByParagraphId(String paragraphId);  }
@Test public void testFilterByClassName() { ResourceSet set = new ResourceSet(); set.add(new Resource(new ResourceId("poo1", "resource1"), "value1")); set.add(new Resource(new ResourceId("poo1", "resource2"), new Integer(2))); assertEquals(1, set.filterByClassnameRegex(".*String").size()); assertEquals(1, set.filterByClassnameRegex(String.class.getName()).size()); assertEquals(1, set.filterByClassnameRegex(".*Integer").size()); assertEquals(1, set.filterByClassnameRegex(Integer.class.getName()).size()); }