GroupDocumentation extends ItemDocumentationSupport { public boolean isMember(ItemDocumentation itemDocumentation) { for (GroupMember groupMember : this.groupMembers) { if(groupMember.matches(itemDocumentation.getId())) { return true; } } return false; }  boolean isMember(ItemDocumentation itemDocumentation); List<GroupMember> getGroupMembers(); void setGroupMembers(List<GroupMember> groupMembers); Integer getMax(); void setMax(Integer max); @Override String toString();  }
@Test public void testIsMember_groupMembersNull() { assertThrows(NullPointerException.class, () -> { new GroupDocumentation().isMember(itemDocumentation); }); }
@Test public void testIsMember() { GroupDocumentation groupDocumentation = new GroupDocumentation(); List<GroupMember> members = new ArrayList<GroupMember>(); groupDocumentation.setGroupMembers(members); assertFalse(groupDocumentation.isMember(itemDocumentation)); GroupMember member = new GroupMember(); member.setId(this.itemDocumentation.getId().substring(0, 3)); members.add(member); assertTrue(groupDocumentation.isMember(itemDocumentation)); }