pref = createNewTimePreference(lastSupplyEndTime, pref);
pref = createNewTimePreference(firstLegalStartTime, pref);
  private NewTask createNewLevel2Task(Task parentTask,                                      Rate newRate,                                      long lastSupplyEndTime) {    Vector newPrefs = new Vector();    Enumeration oldPrefs = parentTask.getPreferences();    long startTime = getTaskUtils().getStartTime(parentTask);    while (oldPrefs.hasMoreElements()) {      Preference pref = (Preference) oldPrefs.nextElement();      if (pref.getAspectType() == AlpineAspectType.DEMANDRATE) {        pref = getTaskUtils().createDemandRatePreference(getPlanningFactory(), newRate);      }      if ((lastSupplyEndTime > startTime) &&          (pref.getAspectType() == AspectType.START_TIME)) {        pref = createNewTimePreference(lastSupplyEndTime, pref);      }      newPrefs.add(pref);    }    Vector newPreps = new Vector();    Enumeration oldPreps = parentTask.getPrepositionalPhrases();    while (oldPreps.hasMoreElements()) {      newPreps.add(oldPreps.nextElement());    }    newPreps.add(newPrepositionalPhrase(Constants.Preposition.READYFORTRANSPORT, translatorPlugin.getOrgName()));    NewTask newTask = getPlanningFactory().newTask();    newTask.setParentTask(parentTask);    newTask.setPlan(parentTask.getPlan());    newTask.setDirectObject(parentTask.getDirectObject());    newTask.setVerb(parentTask.getVerb());    newTask.setPreferences(newPrefs.elements());    newTask.setPrepositionalPhrases(newPreps.elements());    newTask.setContext(parentTask.getContext());    //newTask.setCommitmentDate(parentTask.getCommitmentDate());    return newTask;  }