DataDictionary { public ItemDocumentation findItem(String id) { for (ItemDocumentation doc : this.items) { if(doc.documents(id)) { return doc; } } return null; } DataDictionary(List<ItemDocumentation> items); ItemDocumentation findItem(String id); List<ItemDocumentation> getItems(); void setItems(List<ItemDocumentation> items);  }
@Test public void testFindItem() { assertNull(this.dataDictionary.findItem(itemDocumentation.getId())); this.items.add(itemDocumentation); assertSame(this.itemDocumentation, this.dataDictionary.findItem(itemDocumentation.getId())); assertNull(this.dataDictionary.findItem(this.aliases.get(0))); this.itemDocumentation.setAliases(aliases); assertSame(this.itemDocumentation, this.dataDictionary.findItem(this.aliases.get(0))); }