possibleMatches.addAll (tasksForType);
if (tasksForType == null) { if (isWarnEnabled()) { warn ("Could not find tasks for type <" + type + "> for task " + task.getUID() + " with d.o. " + task.getDirectObject() + " and types <" + types + ">"); } } else { possibleMatches.addAll (tasksForType); }
  protected List getMatchingTasksByType (Task task, Collection units, boolean isReserved) {    List matches = new ArrayList ();    Collection types = getTypesInContainer (task);    // reduce set of possible matching tasks to those for the same types of ammo    List possibleMatches = new ArrayList();    for (Iterator iter = types.iterator(); iter.hasNext(); ) {      String type = (String) iter.next();      List tasksForType = (List)typeToTasks.get(type);      possibleMatches.addAll (tasksForType);    }    if (isInfoEnabled()) {      info ("examining " + possibleMatches.size()+ " possible matches for task " + task.getUID());    }    for (Iterator iter = possibleMatches.iterator (); iter.hasNext(); ) {      Task examinedTask = (Task) iter.next();      if (task.getUID().equals(examinedTask.getUID())) {	if (isInfoEnabled()) {	  info ("skipping self " + examinedTask.getUID());	}	continue; // 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());	continue;      }      */      // is it a reservation task?      boolean examinedIsReserved = isReservedTask (examinedTask);      if ((!isReserved && !examinedIsReserved) ||	  ( isReserved &&  examinedIsReserved)) {	if (isInfoEnabled()) {	  info ("skipping examined transport task because same type " + examinedTask.getUID() + " and " + task.getUID());	}	continue;      }      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.");	  continue;	}      }      else if (!(task instanceof MPTask)) {	if (isInfoEnabled ())	  info ("saw transport task "  + task.getUID() + " vs examined " + examinedTask.getUID());      }      // is it for the same org?      Collection examinedUnits = findForPreps (examinedTask);      Collection copy = new ArrayList(examinedUnits);      examinedUnits.retainAll (units);      if (examinedUnits.isEmpty ()) {	if (isInfoEnabled())	  info ("skipping transport task where units don't match " + units + " vs examined " + copy);	continue;      }      // THIS IS DONE WHEN WE GET POSSIBLE MATCHES      // are they for the same type of supply?      //      if (!contentTypesOverlap (task, examinedTask))       //	continue;      // do the dates overlap      Task reserved, transport;      if (examinedIsReserved) {	reserved  = examinedTask;	transport = task;      }      else {	reserved  = task;	transport = examinedTask;      }      if (transportDateWithinReservedWindow (transport, reserved)) {	matches.add (examinedTask);      }    }    return matches;  }