Optional < PackingPlan . InstancePlan > removeAnyInstanceOfComponent ( String component ) { Optional < PackingPlan . InstancePlan > instancePlan = getAnyInstanceOfComponent ( component ) ; if ( instancePlan . isPresent ( ) ) { PackingPlan . InstancePlan plan = instancePlan . get ( ) ; this . instances . remove ( plan ) ; return instancePlan ; } return Optional . absent ( ) ; }
Remove an instance of a particular component from a container and update its corresponding resources .