while (tasks.hasNext()) { Task t = (Task)tasks.next(); if (!removedTaskList.contains(t)) { removedTaskList.add(t); }
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)) {  overlappingRefillProjections.add(t); } }
    public List clearRefillProjectionTasks() {      Iterator tasks = refillProjections.iterator();      ArrayList removedTaskList = new ArrayList();      while (tasks.hasNext()) {	Task t = (Task)tasks.next();	if (!removedTaskList.contains(t)) {	  removedTaskList.add(t);	}      }      refillProjections.clear();      return removedTaskList;    }