@Test
void changeCapacity() {

    final long vehicleId = 1;
    final int capacity = 123;
    final Vehicle originalVehicle = VehicleFactory.createVehicle(vehicleId, "1", capacity - 10);
    when(vehicleRepository.find(vehicleId)).thenReturn(Optional.of(originalVehicle));
    vehicleService.changeCapacity(vehicleId, capacity);
    verify(vehicleRepository).update(vehicleArgumentCaptor.capture());
    assertThat(vehicleArgumentCaptor.getValue().id()).isEqualTo(vehicleId);
    assertThat(vehicleArgumentCaptor.getValue().capacity()).isEqualTo(capacity);
    verify(optimizer).changeCapacity(vehicleArgumentCaptor.capture());
    assertThat(vehicleArgumentCaptor.getValue().capacity()).isEqualTo(capacity);
}