### Question:
BestNeighborLocalSearch extends LocalSearch { @Override public CVRPSolution findLocalOptimum(CVRPSolution baseSolution) { if (baseSolution == null || !baseSolution.isFeasible()) { throw new IllegalAccessError("invalid initial solution, it is null or unfeasible"); } boolean isLocalOptimum = true; Move move = getMove(); CVRPSolution currentBestSolution = baseSolution; do { isLocalOptimum = true; move.setSolution(currentBestSolution); while (move.hasMoreNeighbors()) { move.nextNeighbor(); if (move.isCurrentNeighborFeasible() && DoubleCompare.lessThan(move.getCurrentNeighborCost(), currentBestSolution.getTotalDistance())) { isLocalOptimum = false; currentBestSolution = move.getCurrentNeighbor(); } } } while (!isLocalOptimum); return currentBestSolution; } BestNeighborLocalSearch(Move moveToUse); @Override CVRPSolution findLocalOptimum(CVRPSolution baseSolution);  }### Answer:
@Test public void shouldReturnSameSolutionAsOptimumForSingleRouteEmptyBaseSolution() { CVRPSolution solution = new CVRPSolution(this.problemInfo, new ArrayList<>(Arrays.asList(new Integer[] { CVRPSolution.SEPARATOR }))); CVRPSolution localOptimum = this.uut.findLocalOptimum(solution); assertEquals(solution, localOptimum); }
@Test public void shouldReturnSameSolutionAsOptimumForSingleRouteSingleClientBaseSolution() { CVRPSolution solution = new CVRPSolution(this.problemInfo, new ArrayList<>(Arrays.asList(new Integer[] { 3, CVRPSolution.SEPARATOR }))); CVRPSolution localOptimum = this.uut.findLocalOptimum(solution); assertEquals(solution, localOptimum); }
@Test public void shouldReturnSameSolutionAsOptimumForMultipleRoutesSingleClientBaseSolution() { CVRPSolution solution = new CVRPSolution(this.problemInfo, new ArrayList<>(Arrays.asList( new Integer[] { 1, CVRPSolution.SEPARATOR, 2, CVRPSolution.SEPARATOR, 3, CVRPSolution.SEPARATOR }))); CVRPSolution localOptimum = this.uut.findLocalOptimum(solution); assertEquals(solution, localOptimum); }