@Test
void createVehicle() {

    final long vehicleId = 63;
    final String name = "Veh5";
    final int capacity = 101;
    VehicleData vehicleData = VehicleFactory.vehicleData(name, capacity);
    final Vehicle vehicle = VehicleFactory.createVehicle(vehicleId, name, capacity);
    when(vehicleRepository.createVehicle(vehicleData)).thenReturn(vehicle);
    vehicleService.createVehicle(vehicleData);
    // verify that vehicle provided by repository is passed to optimizer
    verify(optimizer).addVehicle(vehicle);
}