@Test public void testGetDeepMembers() { Set<IPersonAttributesGroupDefinition> setOfB = new HashSet<>(1); setOfB.add(b); b.setMembers(setOfA); c.setMembers(setOfB); assertNotNull("member set null", b.getDeepMembers()); assertEquals("member is not 1", 1, b.getDeepMembers().size()); assertTrue("member is 'a'", b.getDeepMembers().contains(a)); assertNotNull("member set null", c.getDeepMembers()); assertEquals("member is not 2", 2, c.getDeepMembers().size()); assertTrue("member is 'a'", c.getDeepMembers().contains(a)); assertTrue("member is 'b'", c.getDeepMembers().contains(b)); Set<IPersonAttributesGroupDefinition> setOfBC = new HashSet<>(1); setOfBC.add(b); setOfBC.add(c); c.setMembers(setOfB); d.setMembers(setOfBC); assertNotNull("member set null", d.getDeepMembers()); assertEquals("member is not 3", 3, d.getDeepMembers().size()); assertTrue("member is 'a'", d.getDeepMembers().contains(a)); assertTrue("member is 'b'", d.getDeepMembers().contains(b)); assertTrue("member is 'b'", d.getDeepMembers().contains(c)); }
@Override public Set<IPersonAttributesGroupDefinition> getDeepMembers() { assert (!this.members.contains(this)); Set<IPersonAttributesGroupDefinition> seen = new HashSet<IPersonAttributesGroupDefinition>(); return getDeepMembers(seen); }
PersonAttributesGroupDefinitionImpl implements IPersonAttributesGroupDefinition { @Override public Set<IPersonAttributesGroupDefinition> getDeepMembers() { assert (!this.members.contains(this)); Set<IPersonAttributesGroupDefinition> seen = new HashSet<IPersonAttributesGroupDefinition>(); return getDeepMembers(seen); } }
PersonAttributesGroupDefinitionImpl implements IPersonAttributesGroupDefinition { @Override public Set<IPersonAttributesGroupDefinition> getDeepMembers() { assert (!this.members.contains(this)); Set<IPersonAttributesGroupDefinition> seen = new HashSet<IPersonAttributesGroupDefinition>(); return getDeepMembers(seen); } PersonAttributesGroupDefinitionImpl();  PersonAttributesGroupDefinitionImpl(String name, String description); }
PersonAttributesGroupDefinitionImpl implements IPersonAttributesGroupDefinition { @Override public Set<IPersonAttributesGroupDefinition> getDeepMembers() { assert (!this.members.contains(this)); Set<IPersonAttributesGroupDefinition> seen = new HashSet<IPersonAttributesGroupDefinition>(); return getDeepMembers(seen); } PersonAttributesGroupDefinitionImpl();  PersonAttributesGroupDefinitionImpl(String name, String description); @Override @JsonIgnore long getId(); @Override @JsonIgnore EntityIdentifier getCompositeEntityIdentifierForGroup(); @Override String getName(); @Override void setName(String name); @Override String getDescription(); @Override void setDescription(String description); @Override Set<IPersonAttributesGroupDefinition> getMembers(); @Override Set<IPersonAttributesGroupDefinition> getDeepMembers(); @Override Set<IPersonAttributesGroupDefinition> getDeepMembers(
            Set<IPersonAttributesGroupDefinition> seen); @Override void setMembers(Set<IPersonAttributesGroupDefinition> members); @Override Set<IPersonAttributesGroupTestGroupDefinition> getTestGroups(); @Override void setTestGroups(Set<IPersonAttributesGroupTestGroupDefinition> testGroups); @Override void toElement(org.dom4j.Element parent); }
PersonAttributesGroupDefinitionImpl implements IPersonAttributesGroupDefinition { @Override public Set<IPersonAttributesGroupDefinition> getDeepMembers() { assert (!this.members.contains(this)); Set<IPersonAttributesGroupDefinition> seen = new HashSet<IPersonAttributesGroupDefinition>(); return getDeepMembers(seen); } PersonAttributesGroupDefinitionImpl();  PersonAttributesGroupDefinitionImpl(String name, String description); @Override @JsonIgnore long getId(); @Override @JsonIgnore EntityIdentifier getCompositeEntityIdentifierForGroup(); @Override String getName(); @Override void setName(String name); @Override String getDescription(); @Override void setDescription(String description); @Override Set<IPersonAttributesGroupDefinition> getMembers(); @Override Set<IPersonAttributesGroupDefinition> getDeepMembers(); @Override Set<IPersonAttributesGroupDefinition> getDeepMembers(
            Set<IPersonAttributesGroupDefinition> seen); @Override void setMembers(Set<IPersonAttributesGroupDefinition> members); @Override Set<IPersonAttributesGroupTestGroupDefinition> getTestGroups(); @Override void setTestGroups(Set<IPersonAttributesGroupTestGroupDefinition> testGroups); @Override void toElement(org.dom4j.Element parent);  }