test_class.declarator: scoreDirector
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ScoreDirector<VehicleRoutingSolution> scoreDirector;
test_class.type: ScoreDirector<VehicleRoutingSolution>
test_class.var_name: scoreDirector
test_class.file: optaweb-vehicle-routing-backend/src/test/java/org/optaweb/vehiclerouting/plugin/planner/change/RemoveVehicleTest.java
test_class.identifier: RemoveVehicleTest
test_case.body: @Test
      void fail_fast_if_working_object_is_null() {
          when(scoreDirector.getWorkingSolution()).thenReturn(SolutionFactory.emptySolution());
  
          assertThatIllegalStateException()
                  .isThrownBy(() -> new RemoveVehicle(PlanningVehicleFactory.testVehicle(1)).doChange(scoreDirector))
                  .withMessageContaining("working copy of");
      }
test_case.class_method_signature: RemoveVehicleTest.fail_fast_if_working_object_is_null()
test_case.full_signature: @Test void fail_fast_if_working_object_is_null()
test_case.identifier: fail_fast_if_working_object_is_null
test_case.invocations: thenReturn when getWorkingSolution emptySolution withMessageContaining isThrownBy assertThatIllegalStateException doChange testVehicle
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void fail_fast_if_working_object_is_null()
focal_class.declarator: removedVehicle
focal_class.modifier: private final
focal_class.original_string: private final PlanningVehicle removedVehicle;
focal_class.type: PlanningVehicle
focal_class.var_name: removedVehicle
focal_class.file: optaweb-vehicle-routing-backend/src/main/java/org/optaweb/vehiclerouting/plugin/planner/change/RemoveVehicle.java
focal_class.identifier: RemoveVehicle
focal_class.interfaces: implements ProblemFactChange<VehicleRoutingSolution>
focal_class.class_method_signature: RemoveVehicle.RemoveVehicle(PlanningVehicle removedVehicle)
focal_class.full_signature: public  RemoveVehicle(PlanningVehicle removedVehicle)
focal_class.identifier: RemoveVehicle
focal_class.modifiers: public
focal_class.parameters: (PlanningVehicle removedVehicle)
focal_class.signature:  RemoveVehicle(PlanningVehicle removedVehicle)
focal_class.class_method_signature: RemoveVehicle.doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_class.full_signature: @Override public void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_class.identifier: doChange
focal_class.modifiers: @Override public
focal_class.parameters: (ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_class.return: void
focal_class.signature: void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.body: @Override
      public void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector) {
          VehicleRoutingSolution workingSolution = scoreDirector.getWorkingSolution();
  
          // Look up a working copy of the vehicle
          PlanningVehicle workingVehicle = scoreDirector.lookUpWorkingObject(removedVehicle);
          if (workingVehicle == null) {
              throw new IllegalStateException("Can't look up a working copy of " + removedVehicle);
          }
  
          // Un-initialize all visits of this vehicle
          for (PlanningVisit visit : workingVehicle.getFutureVisits()) {
              scoreDirector.beforeVariableChanged(visit, "previousStandstill");
              visit.setPreviousStandstill(null);
              scoreDirector.afterVariableChanged(visit, "previousStandstill");
          }
  
          // No need to clone the vehicleList because it is a planning entity collection, so it is already
          // planning-cloned.
          // To learn more about problem fact changes, see:
          // https://docs.jboss.org/optaplanner/release/latest/optaplanner-docs/html_single/#problemFactChangeExample
  
          // Remove the vehicle
          scoreDirector.beforeProblemFactRemoved(workingVehicle);
          if (!workingSolution.getVehicleList().remove(workingVehicle)) {
              throw new IllegalStateException(
                      "Working solution's vehicleList "
                              + workingSolution.getVehicleList()
                              + " doesn't contain the workingVehicle ("
                              + workingVehicle
                              + "). This is a bug!");
          }
          scoreDirector.afterProblemFactRemoved(workingVehicle);
  
          scoreDirector.triggerVariableListeners();
      }
focal_method.class_method_signature: RemoveVehicle.doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.full_signature: @Override public void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.identifier: doChange
focal_method.invocations: getWorkingSolution lookUpWorkingObject getFutureVisits beforeVariableChanged setPreviousStandstill afterVariableChanged beforeProblemFactRemoved remove getVehicleList getVehicleList afterProblemFactRemoved triggerVariableListeners
focal_method.modifiers: @Override public
focal_method.parameters: (ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.return: void
focal_method.signature: void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)