ArraysSolvers { public static int[][] toTravelTimeMatrix(List<Point> points, double speed, RoundingMode rm) { return toTravelTimeMatrix(points, SI.METER, Measure.valueOf(speed, SI.METERS_PER_SECOND), SI.SECOND, rm); } 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 travelTimeMatrix() { final Point p0 = new Point(0, 0); final Point p1 = new Point(10, 0); final Point p2 = new Point(10, 10); final Point p3 = new Point(0, 10); final Measure<Double, Velocity> speed1 = Measure.valueOf(40d, KILOMETERS_PER_HOUR); final int[][] matrix1 = ArraysSolvers .toTravelTimeMatrix(asList(p0, p1, p2, p3), KILOMETER, speed1, MINUTE, RoundingMode.CEILING); assertArrayEquals(new int[] {0, 15, 22, 15}, matrix1[0]); assertArrayEquals(new int[] {15, 0, 15, 22}, matrix1[1]); assertArrayEquals(new int[] {22, 15, 0, 15}, matrix1[2]); assertArrayEquals(new int[] {15, 22, 15, 0}, matrix1[3]); final Point p4 = new Point(11, 3); final Measure<Double, Velocity> speed2 = Measure.valueOf(.0699, new ProductUnit<Velocity>(METER.divide(MILLI(SECOND)))); final int[][] matrix2 = ArraysSolvers.toTravelTimeMatrix( asList(p0, p1, p2, p3, p4), METER, speed2, MILLI(SECOND), RoundingMode.FLOOR); assertArrayEquals(new int[] {0, 143, 202, 143, 163}, matrix2[0]); assertArrayEquals(new int[] {143, 0, 143, 202, 45}, matrix2[1]); assertArrayEquals(new int[] {202, 143, 0, 143, 101}, matrix2[2]); assertArrayEquals(new int[] {143, 202, 143, 0, 186}, matrix2[3]); assertArrayEquals(new int[] {163, 45, 101, 186, 0}, matrix2[4]); }