FunctionDocumentation extends BaseDocumentation { public boolean isGroupMember(ItemDocumentation itemDocumentation) { if (this.groups != null) { for (GroupDocumentation group : this.groups) { if (group.isMember(itemDocumentation)) { return true; } } } return false; } FunctionDocumentation(); boolean add(ItemDocumentation itemDocumentation); boolean isGroupMember(ItemDocumentation itemDocumentation); String getDisplayName(); SortedSet<ItemDocumentation> getFields(); boolean hasDisplayName(); void setDisplayName(String displayName); void setFields(SortedSet<ItemDocumentation> fields); List<GroupDocumentation> getGroups(); void setGroups(List<GroupDocumentation> groups); @Override String toString();  }
@Test public void testIsGroupMember() { FunctionDocumentation fd = new FunctionDocumentation(); assertFalse(fd.isGroupMember(iDoc2)); assertFalse(fd.isGroupMember(iDoc1)); fd.setGroups(listOfGroups); assertTrue(fd.isGroupMember(iDoc2)); assertFalse(fd.isGroupMember(iDoc1)); }