Task task = (Task) refillRequisitions.get(i); if (task != null) { lastRefill = i;
ArrayList refills = (ArrayList) refillRequisitions.get(i); if ((refills != null) && (refills.size() > 0)) {   for(int j=0; j < refills.size() ; j++) { Task task = (Task) refills.get(j);  int endBucket = convertTimeToBucket(taskUtils.getEndTime(task),true); lastRefill = Math.max(endBucket,lastRefill); }
    public int getLastRefillRequisition() {        int lastRefill = -1;        for (int i = 0; i < refillRequisitions.size(); i++) {            Task task = (Task) refillRequisitions.get(i);            if (task != null) {                lastRefill = i;            }        }        return lastRefill;    }