ArraysSolvers { public static int computeRouteTardiness(int[] route, int[] arrivalTimes, int[] serviceTimes, int[] dueDates, int remainingServiceTime) { int tardiness = 0; for (int i = 1; i < route.length; i++) { final int st; if (i == 1 && remainingServiceTime > 0) { st = remainingServiceTime; } else { st = serviceTimes[route[i]]; } final int lateness = arrivalTimes[i] + st - dueDates[route[i]]; if (lateness > 0) { tardiness += lateness; } } return tardiness; } private  ArraysSolvers(); static int[][] toTravelTimeMatrix(List<Point> points, double speed,
      RoundingMode rm); static int[][] toTravelTimeMatrix(List<Point> points,
      Unit<Length> distUnit, Measure<Double, Velocity> speed,
      Unit<Duration> outputTimeUnit, RoundingMode rm); static ArraysObject toSingleVehicleArrays(GlobalStateObject state,
      Unit<Duration> outputTimeUnit); static MVArraysObject toMultiVehicleArrays(GlobalStateObject state,
      Unit<Duration> outputTimeUnit); static ImmutableList<Parcel> convertSolutionObject(
      SolutionObject sol, Map<Integer, ParcelIndexObj> index2parcel); static int computeTotalTravelTime(int[] route, int[][] travelTime,
      int[] vehicleTravelTimes); static int computeRouteTardiness(int[] route, int[] arrivalTimes,
      int[] serviceTimes, int[] dueDates, int remainingServiceTime); static int computeTotalObjectiveValue(SolutionObject[] sols); static int computeTotalObjectiveValue(SolutionObject[] sols,
      Unit<Duration> inputUnit, Unit<Duration> outputUnit);  }
@Test public void computeSumTardinessTest() { final int[] route = new int[] {0, 1, 2, 3}; final int[] arrivalTimes = new int[] {50, 70, 90, 100}; final int[] serviceTimes = new int[] {0, 5, 5, 0}; final int[] dueDates = new int[] {40, 70, 80, 110}; final int tardiness = ArraysSolvers.computeRouteTardiness(route, arrivalTimes, serviceTimes, dueDates, 0); assertEquals(20, tardiness); }