ArraysSolvers { static int[] convertTW(TimeWindow tw, long time, UnitConverter timeConverter) { final int releaseDate = fixTWstart(tw.begin(), time, timeConverter); final int dueDate = fixTWend(tw.end(), time, timeConverter); if (releaseDate > dueDate) { checkArgument(Math.abs(dueDate - releaseDate) == 1); return new int[] {dueDate, releaseDate}; } return new int[] {releaseDate, dueDate}; } 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 convertTWtest() { final UnitConverter timeConverter = MILLI(SECOND).getConverterTo(SECOND); final int[] tw1 = convertTW(TimeWindow.create(300, 800), 5, timeConverter); assertEquals(0, tw1[0]); assertEquals(1, tw1[1]); final int[] tw2 = convertTW(TimeWindow.create(7300, 8800), 0, timeConverter); assertEquals(8, tw2[0]); assertEquals(8, tw2[1]); final int[] tw3 = convertTW(TimeWindow.create(7300, 8800), 7300, timeConverter); assertEquals(0, tw3[0]); assertEquals(1, tw3[1]); }