} */  Set unplannedInternal = new HashSet(); for (Iterator iter = allInternalTasks.getCollection().iterator(); iter.hasNext(); ) { Task internalTask = (Task) iter.next (); if (internalTask.getPlanElement() == null) { unplannedInternal.add (internalTask); } }  toSubtract = new HashSet(allInternalTasks.getRemovedCollection());  unplannedInternal.removeAll (toSubtract); handleUnplanned(unplannedInternal); toSubtract.addAll (unplannedInternal);  if (getLoggingService().isInfoEnabled()) { getLoggingService().info("Packer - subtracting " + toSubtract.size () + " tasks."); }  for (Iterator iter = toSubtract.iterator(); iter.hasNext(); ) { subtractTaskFromReceiver ((Task)iter.next());
  public void processRemovedTasks(Enumeration removedTasks) {    boolean anyRemoved = false;    while (removedTasks.hasMoreElements()) {      anyRemoved = true;      Task task = (Task) removedTasks.nextElement();      if (getLoggingService().isInfoEnabled()) {        getLoggingService().info("Packer: Got a removed task - " +                                 task.getUID() +                                 " from " + task.getSource());      }      REMOVE_TASKS++;      REMOVE_TONS += task.getPreferredValue(AspectType.QUANTITY);      if (getLoggingService().isInfoEnabled()) {        getLoggingService().info("Packer - number of removed SUPPLY tasks: " +                                 REMOVE_TASKS +                                 ", aggregated quantity from removed SUPPLY tasks: " +                                 REMOVE_TONS + " tons.");      }    }    if (anyRemoved) {      Collection unplannedInternal = getBlackboardService().query(new UnaryPredicate() {        public boolean execute(Object obj) {          if (obj instanceof Task) {            Task task = (Task) obj;            return ((task.getPrepositionalPhrase(GenericPlugin.INTERNAL) != null) &&                task.getPlanElement() == null);          }          return false;        }      }      );      handleUnplanned(unplannedInternal);    }  }