t = (Task) refillProjections.get(i); if ((t != null) && (!removedTaskList.contains(t))) { long start = taskUtils.getStartTime(t); if (start > now) {
refills = (ArrayList) refillProjections.get(i); if(refills != null) { ArrayList refillsToRemove = new ArrayList(refills.size()); for(int j=0; j < refills.size(); j++) { t = (Task) refills.get(j); if ((t != null) && (!removedTaskList.contains(t))) { long start = taskUtils.getStartTime(t); if (start > now) { refillsToRemove.add(t); if(!removedTaskList.contains(t)) { removedTaskList.add(t); } } else if ((start < now) && (taskUtils.getEndTime(t) > now)) {  if (!overlappingRefillProjections.contains(t)) { overlappingRefillProjections.add(t); } } } } refills.removeAll(refillsToRemove); if(refills.size() == 0) {
    public List clearRefillProjectionTasks(long now) {      ArrayList removedTaskList = new ArrayList();      overlappingRefillProjections.clear();      Task t;      for (int i = 0; i < refillProjections.size(); i++) {	  t = (Task) refillProjections.get(i);	  if ((t != null) && (!removedTaskList.contains(t))) {	      long start = taskUtils.getStartTime(t);	      if (start > now) { 		  refillProjections.set(i, null);		  removedTaskList.add(t);	      } else if ((start < now) && (taskUtils.getEndTime(t) > now)) {		  //this task spans now - shorten it	                if (!overlappingRefillProjections.contains(t)) {		  overlappingRefillProjections.add(t);                }	      }	  }      }      return removedTaskList;    }