long endTime = getEndTime(task); int bucket = convertTimeToBucket(endTime); while (bucket >= refillRequisitions.size()) { refillRequisitions.add(null);
long endTime = getEndTime(task); int bucket = convertTimeToBucket(endTime); while (bucket >= refillRequisitions.size()) { refillRequisitions.add(null); } refillRequisitions.set(bucket, task);
  public void addRefillRequisition(Task task) {    long endTime = getEndTime(task);    int bucket = convertTimeToBucket(endTime);    while (bucket >= refillRequisitions.size()) {      refillRequisitions.add(null);    }    refillRequisitions.set(bucket, task);  }