MulticastTree extends NetworkElement { public Set<SharedRiskGroup> getSRGs () { checkAttachedToNetPlanObject(); Set<SharedRiskGroup> res = new TreeSet<SharedRiskGroup> (); for (Link e : linkSet) res.addAll (e.getSRGs()); for (Node n : cache_traversedNodes) res.addAll (n.getSRGs()); return res; } MulticastTree(NetPlan netPlan , long id , int index,  MulticastDemand demand , Set<Link> links , AttributeMap attributes); Set<Link> getInitialLinkSet(); void revertToInitialSetOfLinks(); boolean isUpTheInitialLinkSet(); NetworkLayer getLayer(); Set<SharedRiskGroup> getSRGs(); MulticastDemand getMulticastDemand(); Node getIngressNode(); Set<Node> getEgressNodesReached(); boolean isReachedEgressNode(Node n); boolean isReachinAllDemandEgressNodes(); List<Link> getSeqLinksToEgressNode(Node egressNode); void setLinks(Set<Link> newLinkSet); Set<Link> getLinkSet(); boolean isDown(); boolean isTraversingZeroCapLinks(); Set<Node> getNodeSet(); Link getIngressLinkOfNode(Node n); Set<Link> getOutputLinkOfNode(Node n); double getTreeTotalLengthInKm(); double getTreeMaximumPathLengthInKm(); double getTreeAveragePathLengthInKm(); double getTreeMaximumPropagationDelayInMs(); double getTreeAveragePropagationDelayInMs(); int getTreeMaximumPathLengthInHops(); double getTreeAveragePathLengthInHops(); int getTreeNumberOfLinks(); double getCarriedTraffic(); double getOccupiedLinkCapacity(); double getCarriedTrafficInNoFailureState(); double getOccupiedLinkCapacityInNoFailureState(); void setCarriedTraffic(double newCarriedTraffic , double newOccupiedLinkCapacity); void remove(); @Override String toString();  }
@Test public void testGetSRGs() { assertEquals (t123.getSRGs() , Collections.emptySet()); SharedRiskGroup srg = np.addSRG(1,1,null); srg.addLink(link13); assertEquals (t123.getSRGs() , Collections.emptySet()); assertEquals (tStar.getSRGs() , Collections.singleton(srg)); srg.addLink(link12); assertEquals (t123.getSRGs() , Collections.singleton(srg)); assertEquals (tStar.getSRGs() , Collections.singleton(srg)); srg.removeLink(link13); srg.removeLink(link12); assertEquals (t123.getSRGs() , Collections.emptySet()); assertEquals (tStar.getSRGs() , Collections.emptySet()); srg.addNode(n2); assertEquals (t123.getSRGs() , Collections.singleton(srg)); assertEquals (tStar.getSRGs() , Collections.singleton(srg)); }