FunctionDocumentation extends BaseDocumentation { public void setFields(SortedSet<ItemDocumentation> fields) { if (fields != null) { initFields(); for (ItemDocumentation itemDocumentation : fields) { add(itemDocumentation); } } } 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 testSetFields() { FunctionDocumentation fd = new FunctionDocumentation(); fd.setGroups(listOfGroups); this.sortedSetOfItemDocs.add(iDoc1); this.sortedSetOfItemDocs.add(iDoc2); fd.setFields(sortedSetOfItemDocs); assertEquals(1, fd.getFields().size()); assertTrue(fd.getFields().contains(iDoc1)); }