SharedRiskGroup extends NetworkElement { public void remove() { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (!isDynamicSrg()) { for (Node node : nodesIfNonDynamic) node.cache_nodeNonDynamicSRGs.remove (this); for (Link link : linksIfNonDynamic) link.cache_nonDynamicSrgs.remove (this); } else { dynamicSrgImplementation.remove(); } for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); netPlan.cache_id2srgMap.remove (id); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.srgs , index); if (isDynamicSrg()) netPlan.cache_dynamicSrgs.remove(this); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); } SharedRiskGroup(NetPlan netPlan , long id , int index , SortedSet<Node> nodes , SortedSet<Link> links , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes);   SharedRiskGroup(NetPlan netPlan , long id , int index , String className , String dynamicInitializationString , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes); boolean isDynamicSrg(); DynamicSrgImplementation getDynamicSrgImplementation(); void setDynamicImplementation(DynamicSrgImplementation impl); boolean isStaticEmptySrg(); boolean isDynamicCurrentlyEmptySrg(); static SharedRiskGroup getDummyEmptyStaticSrg(NetPlan np); static SortedSet<SharedRiskGroup> getSrgListCompletedWithDummyNoFailureStateIfNeeded(Collection<SharedRiskGroup> sourceSrgs , NetPlan np); SortedSet<Node> getNodes(); SortedSet<Link> getAffectedLinksAllLayers(); SortedSet<Link> getAffectedLinks(NetworkLayer layer); SortedSet<Route> getAffectedRoutesAllLayers(); SortedSet<Route> getAffectedRoutes(NetworkLayer layer); SortedSet<MulticastTree> getAffectedMulticastTreesAllLayers(); SortedSet<MulticastTree> getAffectedMulticastTrees(NetworkLayer layer); boolean affectsAnyOf(Collection<? extends NetworkElement> col); SortedSet<Link> getLinksAllLayers(); SortedSet<Link> getLinks(NetworkLayer layer); double getMeanTimeToFailInHours(); void setMeanTimeToFailInHours(double value); double getMeanTimeToRepairInHours(); void setMeanTimeToRepairInHours(double value); double getAvailability(); void setAsDown(); void setAsUp(); void removeLink(Link e); void removeNode(Node n); void remove(); void addLink(Link link); void addNode(Node node); String toString();  }
@Test public void testRemove() { assertEquals(np.getSRGs() , Arrays.asList(srgL13 , srgN1L23)); srgL13.remove(); assertEquals(np.getSRGs() , Arrays.asList(srgN1L23)); }