Resource extends NetworkElement { public SortedSet<Route> getTraversingRoutes() { return new TreeSet<> (cache_traversingRoutesAndOccupiedCapacitiesIfNotFailingRoute.keySet()); } Resource(NetPlan netPlan , long id , int index , String type , String name , Optional<Node> hostNode , 
			double capacity , String capacityMeasurementUnits,
			Map<Resource,Double> capacityIOccupyInBaseResource , double processingTimeToTraversingTraffic , 
			AttributeMap attributes); double getUtilization(); boolean isOversubscribed(); double getProcessingTimeToTraversingTrafficInMs(); void setProcessingTimeToTraversingTrafficInMs(double time); URL getUrlIcon(); void setUrlIcon(URL url); String getType(); Optional<Node> getHostNode(); boolean iAttachedToANode(); String getCapacityMeasurementUnits(); void setCapacityMeasurementUnits(String units); double getCapacity(); double getOccupiedCapacity(); boolean isHavingMoreThanOneBaseResourceWithTheSameType(); SortedSet<Resource> getBaseResources(); SortedSet<Resource> getUpperResources(); double getCapacityOccupiedInBaseResource(Resource baseResource); double getCapacityOccupiedByUpperResource(Resource upperResource); SortedMap<Resource, Double> getCapacityOccupiedInBaseResourcesMap(); SortedMap<Resource, Double> getCapacityOccupiedByUpperResourcesMap(); SortedSet<Demand> getTraversingDemands(); SortedSet<Route> getTraversingRoutes(); double getTraversingRouteOccupiedCapacity(Route route); SortedMap<Route,Double> getTraversingRouteOccupiedCapacityMap(); void setCapacity(double newCapacity , Map<Resource,Double> newCapacityIOccupyInBaseResourcesMap); void remove(); @Override String toString(); void dettachFromNode(); void attachToNode(Node node);  }
@Test public void testGetTraversingRoutes () { assertEquals (baseResource.getTraversingRoutes() , Collections.singleton(serviceChainBase)); assertEquals (upperResource.getTraversingRoutes() , Collections.singleton(serviceChainUpper)); }