@Test
void remove_last_visit() {

    VehicleRoutingSolution solution = SolutionFactory.emptySolution();
    when(scoreDirector.getWorkingSolution()).thenReturn(solution);
    PlanningVisit removedVisit = testVisit(1);
    PlanningVisit otherVisit = testVisit(2);
    solution.getVisitList().add(otherVisit);
    solution.getVisitList().add(removedVisit);
    // V -> other -> removed
    otherVisit.setPreviousStandstill(testVehicle(10));
    otherVisit.setNextVisit(removedVisit);
    removedVisit.setPreviousStandstill(otherVisit);
    when(scoreDirector.lookUpWorkingObject(removedVisit)).thenReturn(removedVisit);
    // do change
    RemoveVisit removeVisit = new RemoveVisit(removedVisit);
    removeVisit.doChange(scoreDirector);
    verify(scoreDirector).beforeEntityRemoved(removedVisit);
    verify(scoreDirector).afterEntityRemoved(removedVisit);
    assertThat(solution.getVisitList()).containsExactly(otherVisit);
    verify(scoreDirector).triggerVariableListeners();
}