ItemDocumentation extends BaseDocumentation { public boolean documents(String id) { String myId = getId(); if (myId != null && myId.equals(id)) { return true; } if (isAliased()) { for (String alias : this.aliases) { if (alias.equals(id)) { return true; } } } return false; } ItemDocumentation();  ItemDocumentation(String id); ItemDocumentation copyWithDisplayName(String nameToUse); boolean documents(String id); List<String> getAliases(); String getDisplayName(); void setDisplayName(String displayName); String getFormat(); List<String> getFunctionNames(); List<String> getSeeAlso(); List<Table> getTables(); void setAliases(List<String> aliases); void setFormat(String format); void setFunctionNames(List<String> functionNames); void setSeeAlso(List<String> itemDocumentationIds); void setTables(List<Table> tables); @Override String toString();  }
@Test public void testDocuments() { String id = "abc"; ItemDocumentation itemDocumentation = new ItemDocumentation(); assertFalse(itemDocumentation.documents(id)); itemDocumentation.setId(id); assertTrue(itemDocumentation.documents(id)); itemDocumentation.setId(null); List<String> aliases = new ArrayList<String>(); itemDocumentation.setAliases(aliases); assertFalse(itemDocumentation.documents(id)); aliases.add(id); assertTrue(itemDocumentation.documents(id)); }