@Test
void solution_created_from_vehicles_depot_and_visits_should_be_consistent() {

    PlanningVehicle vehicle = new PlanningVehicle();
    PlanningLocation depotLocation = PlanningLocationFactory.testLocation(1);
    PlanningDepot depot = new PlanningDepot(depotLocation);
    PlanningVisit visit = PlanningVisitFactory.testVisit(2);
    VehicleRoutingSolution solutionWithDepot = SolutionFactory.solutionFromVisits(
            singletonList(vehicle),
            depot,
            singletonList(visit));
    assertThat(solutionWithDepot.getVehicleList()).containsExactly(vehicle);
    assertThat(vehicle.getDepot()).isEqualTo(depot);
    assertThat(solutionWithDepot.getDepotList()).containsExactly(depot);
    assertThat(solutionWithDepot.getVisitList()).hasSize(1);
    assertThat(solutionWithDepot.getVisitList()).containsExactly(visit);
    assertThat(solutionWithDepot.getVisitList().get(0).getLocation()).isEqualTo(visit.getLocation());
    VehicleRoutingSolution solutionWithNoDepot = SolutionFactory.solutionFromVisits(
            singletonList(vehicle),
            null,
            emptyList());
    assertThat(solutionWithNoDepot.getDepotList()).isEmpty();
}