- Create class
Car
. - Create
CarService
interface with implementation.
- Car create(Car car);
- Car get(Long id);
- List<Car> getAll();
- Car update(Car car);
- boolean delete(Long id);
- void addDriverToCar(Driver driver, Car car); // these two methods
- void removeDriverFromCar(Driver driver, Car car); // should only be on service layer
- List<Car> getAllByDriver(Long driverId);
- Test your solution in the
main
method. - Don't forget about a table's and columns' namings.
Before submitting solution make sure you checked it first with checklist