if (!(examinedTask.getVerb ().equals (Constants.Verb.TRANSPORT))) { if (isDebugEnabled()) debug ("skipping non-transport task " + examinedTask.getUID()); return false; }   boolean examinedIsReserved = isReservedTask (examinedTask); if ((!isReserved && !examinedIsReserved) || ( isReserved &&  examinedIsReserved)) { if (isDebugEnabled()) debug ("skipping examined transport task because same type " + examinedTask.getUID() + " and " + task.getUID()); return false; }  if (examinedIsReserved) {  if (!taskInWorkflow (examinedTask, examinedTask.getWorkflow())) { if (isInfoEnabled ()) info ("skipping reserved transport task " + examinedTask.getUID() + " since it's already been removed from it's workflow."); return false; } } else if (!(task instanceof MPTask)) { if (isInfoEnabled ()) info ("saw transport task "  + task.getUID()); }   Collection examinedUnits = findForPreps (examinedTask); Collection copy = new ArrayList(examinedUnits); examinedUnits.retainAll (units); if (examinedUnits.isEmpty ()) { if (isDebugEnabled()) debug ("skipping transport task where units don't match " + units + " vs examined " + copy); return false; }   if (!contentTypesOverlap (task, examinedTask)) return false;   Task reserved, transport; if (examinedIsReserved) { reserved  = examinedTask; transport = task; } else { reserved  = task; transport = examinedTask; }  return transportDateWithinReservedWindow (transport, reserved); }
      public boolean execute (Object obj) {        if (!(obj instanceof Task)) return false;        Task examinedTask = (Task) obj;        if (task.getUID().equals(examinedTask.getUID())) {          if (isDebugEnabled())            debug ("skipping self " + examinedTask.getUID());          return false; // don't match yourself        }        // better be a transport task        if (!(examinedTask.getVerb ().equals (Constants.Verb.TRANSPORT))) {          if (isDebugEnabled())            debug ("skipping non-transport task " + examinedTask.getUID());          return false;        }        // is it a reservation task?        boolean examinedIsReserved = isReservedTask (examinedTask);        if ((!isReserved && !examinedIsReserved) ||            ( isReserved &&  examinedIsReserved)) {          if (isDebugEnabled())            debug ("skipping examined transport task because same type " + examinedTask.getUID() + " and " + task.getUID());          return false;        }        if (examinedIsReserved) {          // has it already been removed from workflow?          if (!taskInWorkflow (examinedTask, examinedTask.getWorkflow())) {            if (isInfoEnabled ())              info ("skipping reserved transport task " + examinedTask.getUID() +                    " since it's already been removed from it's workflow.");            return false;          }        }        else if (!(task instanceof MPTask)) {          if (isInfoEnabled ())            info ("saw transport task "  + task.getUID());        }        // is it for the same org?        Collection examinedUnits = findForPreps (examinedTask);        Collection copy = new ArrayList(examinedUnits);        examinedUnits.retainAll (units);        if (examinedUnits.isEmpty ()) {          if (isDebugEnabled())            debug ("skipping transport task where units don't match " + units + " vs examined " + copy);          return false;        }        // are they for the same type of supply?        if (!contentTypesOverlap (task, examinedTask)) return false;        // do the dates overlap        Task reserved, transport;        if (examinedIsReserved) {          reserved  = examinedTask;          transport = task;        }        else {          reserved  = task;          transport = examinedTask;        }        return transportDateWithinReservedWindow (transport, reserved);      }