I am issuing cars for a car rental class using the driving licence and using the car type as input parameters to my method. as I am using an interface, I have to issue big and small cars depending on the driver's age and the time they have had the licence. for ex: for a big car, he needs to be at least 23 and to have 4 years driving experience. I am stuck on how to check the type of car the driver will be issued and the subsequent age checks. My code is a little messy but I could really use some help as I can't logically advance. below is my method.

```
public CarInterface issueCar(DrivingLicence aLicence, CarType typeOfCar) {
    final boolean isLicenceFull = drivingLicence.getLicenceStatus();

     final Optional<CarInterface> optionalCar = availableCars.stream()
           .filter(car -> typeOfCar == car.getType())
           .findAny();

     final CarInterface car = optionalCar.orElseThrow(() -> new RuntimeException("All cars of type " + typeOfCar + " have been rented"));
        if(aLicence.getLicenceStatus() ==true){
            if(!rentals.containsKey(aLicence)){
                if(typeOfCar.equals(optionalCar)){

                }
            }
        }

```