SharedRiskGroup extends NetworkElement { public void removeNode (Node n) { if (isDynamicSrg()) throw new Net2PlanException ("Cannot modify dynamic SRGs"); checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); n.cache_nodeNonDynamicSRGs.remove (this); nodesIfNonDynamic.remove (n); if (ErrorHandling.isDebugEnabled()) netPlan.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 testRemoveNode() { srgL13.removeNode(n1); assertEquals(srgL13.getNodes() , new TreeSet<Node> (Arrays.asList())); assertEquals(srgN1L23.getNodes() , new TreeSet<Node> (Arrays.asList(n1))); srgN1L23.removeNode(n1); assertEquals(srgN1L23.getNodes() , new TreeSet<Node> (Arrays.asList())); }