vehicles-api/src/main/java/com/udacity/vehicles/service/CarService.java
public void delete(Long id) {
    // Attempt to grab the car from the database
    Optional<Car> optionalCar = repository.findById(id);
    Car car = optionalCar.orElseThrow(CarNotFoundException::new);
    repository.delete(car);
  }
/**
   * Deletes a given car by ID
   *
   * @param id the ID number of the car to delete
   */
Deletes a given car by ID
@param id the ID number of the car to delete
Deletes a given car by ID @param id the ID number of the car to delete
public void delete(Long id) {
    Optional<Car> optionalCar = repository.findById(id);
    Car car = optionalCar.orElseThrow(CarNotFoundException::new);
    repository.delete(car);
  }
public void delete ( Long id ) { Optional < Car > optionalCar = repository . findById ( id ) ; Car car = optionalCar . orElseThrow ( CarNotFoundException :: new ) ; repository . delete ( car ) ; }
Deletes a given car by ID
 @param id the ID number of the car to delete
Deletes a given car by ID @param id the ID number of the car to delete
// Attempt to grab the car from the database