@Test
void remove_middle_visit() {

    VehicleRoutingSolution solution = SolutionFactory.emptySolution();
    when(scoreDirector.getWorkingSolution()).thenReturn(solution);
    PlanningVisit firstVisit = testVisit(1);
    PlanningVisit middleVisit = testVisit(2);
    PlanningVisit lastVisit = testVisit(3);
    solution.getVisitList().add(firstVisit);
    solution.getVisitList().add(lastVisit);
    solution.getVisitList().add(middleVisit);
    // V -> first -> removed -> last
    firstVisit.setPreviousStandstill(testVehicle(1));
    firstVisit.setNextVisit(middleVisit);
    middleVisit.setPreviousStandstill(firstVisit);
    middleVisit.setNextVisit(lastVisit);
    lastVisit.setPreviousStandstill(middleVisit);
    PlanningVisit removedVisit = testVisit(2);
    when(scoreDirector.lookUpWorkingObject(removedVisit)).thenReturn(middleVisit);
    // do change
    RemoveVisit removeVisit = new RemoveVisit(removedVisit);
    removeVisit.doChange(scoreDirector);
    verify(scoreDirector).beforeVariableChanged(lastVisit, "previousStandstill");
    verify(scoreDirector).afterVariableChanged(lastVisit, "previousStandstill");
    verify(scoreDirector).beforeEntityRemoved(middleVisit);
    verify(scoreDirector).afterEntityRemoved(middleVisit);
    assertThat(solution.getVisitList())
            .hasSize(2)
            .containsOnly(firstVisit, lastVisit);
    // V -> first -> removed -> last
    assertThat(lastVisit.getPreviousStandstill()).isEqualTo(firstVisit);
    verify(scoreDirector).triggerVariableListeners();
}