@Test public void testGetDescendantObjectsEmpty() { AddressGroup ag = new AddressGroup("group"); assertThat( ag.getDescendantObjects(ImmutableMap.of(), ImmutableMap.of(), new HashSet<>()), equalTo(ImmutableSet.of())); }
@VisibleForTesting Set<String> getDescendantObjects( Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups, Set<String> alreadyTraversedGroups) { if (alreadyTraversedGroups.contains(_name)) { return ImmutableSet.of(); } alreadyTraversedGroups.add(_name); if (_type == Type.STATIC) { return getStaticDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } else if (_type == Type.DYNAMIC) { return getDynamicDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } return ImmutableSet.of(); }
AddressGroup implements Serializable { @VisibleForTesting Set<String> getDescendantObjects( Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups, Set<String> alreadyTraversedGroups) { if (alreadyTraversedGroups.contains(_name)) { return ImmutableSet.of(); } alreadyTraversedGroups.add(_name); if (_type == Type.STATIC) { return getStaticDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } else if (_type == Type.DYNAMIC) { return getDynamicDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } return ImmutableSet.of(); } }
AddressGroup implements Serializable { @VisibleForTesting Set<String> getDescendantObjects( Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups, Set<String> alreadyTraversedGroups) { if (alreadyTraversedGroups.contains(_name)) { return ImmutableSet.of(); } alreadyTraversedGroups.add(_name); if (_type == Type.STATIC) { return getStaticDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } else if (_type == Type.DYNAMIC) { return getDynamicDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } return ImmutableSet.of(); } AddressGroup(String name); }
AddressGroup implements Serializable { @VisibleForTesting Set<String> getDescendantObjects( Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups, Set<String> alreadyTraversedGroups) { if (alreadyTraversedGroups.contains(_name)) { return ImmutableSet.of(); } alreadyTraversedGroups.add(_name); if (_type == Type.STATIC) { return getStaticDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } else if (_type == Type.DYNAMIC) { return getDynamicDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } return ImmutableSet.of(); } AddressGroup(String name); IpSpace getIpSpace(
      Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups); RangeSet<Ip> getIpRangeSet(
      Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups); @Nullable String getDescription(); @Nullable String getFilter(); void addMember(String member); Set<String> getMembers(); String getName(); @Nonnull Set<String> getTags(); @Nullable Type getType(); void setDescription(String description); void setFilter(String filter); }
AddressGroup implements Serializable { @VisibleForTesting Set<String> getDescendantObjects( Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups, Set<String> alreadyTraversedGroups) { if (alreadyTraversedGroups.contains(_name)) { return ImmutableSet.of(); } alreadyTraversedGroups.add(_name); if (_type == Type.STATIC) { return getStaticDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } else if (_type == Type.DYNAMIC) { return getDynamicDescendantObjects(addressObjects, addressGroups, alreadyTraversedGroups); } return ImmutableSet.of(); } AddressGroup(String name); IpSpace getIpSpace(
      Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups); RangeSet<Ip> getIpRangeSet(
      Map<String, AddressObject> addressObjects, Map<String, AddressGroup> addressGroups); @Nullable String getDescription(); @Nullable String getFilter(); void addMember(String member); Set<String> getMembers(); String getName(); @Nonnull Set<String> getTags(); @Nullable Type getType(); void setDescription(String description); void setFilter(String filter);  }