private static void frontloadFrom(Date projectStart, IActivityTO activity) {
   // set my earlyStart to the maximum of projectStart and
   // the earlyFinish of all predecessors
   Date earliest = projectStart;
   for (IActivityTO predecessor : activity.getPredecessors()) {
     if (predecessor.getUntil().after(earliest)) {
       earliest = predecessor.getUntil();
     }
   }
   activity.setFrom(earliest);
 }
    public static void frontloadFrom(Date projectStart, List<IActivityTO> currentActivities) {

      for (IActivityTO activity : currentActivities) {

        if (activity.hasBeenPlanned()) continue;

        frontloadFrom(projectStart, activity.getPredecessors());

        // finally we can plan this task, because all predecessors are now planned
        frontloadFrom(projectStart, activity);
      }
    }