private Integer calculateArrivalTime(Customer customer, Integer previousDepartureTime) {

    // para que no falle al final del while
    if (customer == null) {
      return null;
    }
    // no ha sido asignado
    if (previousDepartureTime == null) {
      return Integer.valueOf(
          (int) Math.max(customer.getReadyTime(), customer.getSecondsFromPreviousStandstill()));
    }
    // caso común
    return Integer.valueOf(
        (int) (previousDepartureTime.intValue() + customer.getSecondsFromPreviousStandstill()));
  }