RouteOptimizerImpl implements RouteOptimizer { @Override public void removeAllVehicles() { solverManager.stopSolver(); vehicles.clear(); publishSolution(); } @Autowired  RouteOptimizerImpl(SolverManager solverManager, RouteChangedEventPublisher routeChangedEventPublisher); @Override void addLocation(Location domainLocation, DistanceMatrixRow distanceMatrixRow); @Override void removeLocation(Location domainLocation); @Override void addVehicle(Vehicle domainVehicle); @Override void removeVehicle(Vehicle domainVehicle); @Override void changeCapacity(Vehicle domainVehicle); @Override void removeAllLocations(); @Override void removeAllVehicles();  }
@Test void removing_all_vehicles_should_not_fail_when_solver_is_not_solving() { assertThatCode(() -> routeOptimizer.removeAllVehicles()).doesNotThrowAnyException(); }