In this lab, weare going to further hone ourJava class making abilities. Specifically, we will create a class with methods, getters and setters, instance properties, and more importantly constructors. In this lab, we will create two classes, a Car.java and CarDriver.java. You will not be provided a driver class for this lab. You must provide JavaDoc for all methods and classes in this lab as well as line comments where needed. Create a project named Lab4and also create the Car.java and CarDriver.java classes in this project. Also note that when working with multiple constructors, do not forget to use the this() keyword to call the workhorse constructoreither directly or indirectly.Class Car: Create a class named Carthat has the following private Instance Properties:â€¢int yearModel â€“The yearModel field is aninteger of the carâ€™s year.The year cannot be greater than 2022 and smaller than 1885.â€¢String make â€“The make field is a String of the carâ€™s make.â€¢String model â€“The model field is a String that holds the model of the car.â€¢String owner â€“The owned field is a String that holds the name of the owner of the car.â€¢int speed â€“The speed Instance Property is an integer that holds contains the carâ€™s current speed in miles per hour (mph). The speed cannot be a negative number. The maximum speed ofa car is 250 mph. You have to ensure that the speed is within the valid range when a car accelerates or brakes.â€¢double fuelLevel â€“A double that holds the current fuel level of the car. This value ranges from 0 to 1.0. You have to make sure the value is always within this.â€¢boolean start â€“A boolean that is true if the car engine has been turned on and false if it is off.The Carclass should contain the following methods: â€¢public Car() â€“The default (or empty) constructor that initializes the instance properties to the default values (speed to 0, fuel level to 1.0, start to false, year model to 2022, and all strings to â€œâ€).â€¢public Car(String owner, String make, String model, int yearModel) â€“A partial constructor that initializes the instance properties using the input parameters. Initialize the speed to 0, start to false, and fuel level to 1.0.
â€¢public Car(String owner, String make, String model, int yearModel, double fuelLevel) â€“A partial constructor that initializes the instance properties using the input parameters. Initialize the speed to 0 and start to false.â€¢public Car(String owner, String make, String model, int yearModel, double fuelLevel, int speed, boolean start) â€“The workhorse constructor that initializes all instance properties with the input parameters.â€¢public Car(Car anotherCar) â€“The copy constructor that initializes the instance properties using the values of anotherCarâ€™s instance properties.â€¢public booleanaccelerate() â€“This method increments the carâ€™s speed by 4 mph and decreases the carâ€™s fuelLevel by 0.05. The car cannot accelerate if the engine is not on. Also, do not accelerate if the car does not have enough fuel (at least 0.05). If the current speed is the maximum (250 mph) then the acceleration will not increase the speed but will decrement the fuel.The method returns true if the car accelerates (i.e., increases the car speed by some amount) and false,otherwise.â€¢public booleanbrake() â€“This method decrements the carâ€™s speed by 3 mph. The car must have its engine on in order to apply the brake. The speed cannot be negative as a result of a brake. If you brake whenthe carâ€™s speed is 3 mph or less, then the brake call will reduce the speed to 0 mph.The method returns true if it can apply the brake and reduce the speed by some amount and false, otherwise.â€¢public boolean isGasTankEmpty() â€“This method returns true if the fuel level of the car is less than 0.05 and false, otherwise.â€¢public boolean sameOwner(Car anotherCar) â€“This method returns true if the two cars have the same owner and false, otherwise. We assume that each car owner as a unique name.â€¢public boolean equals(Object o) â€“Override the default Object class equals()method.This method returns true if the two cars have the same make, model, and yearModel and false, otherwise.â€¢public String toString() â€“Override the default Object class toString(). This method returnsa string representation of the car that includes the owner, make, model, yearModel, fuelLevel, and speed of the car. An example return of this method call is as follows. â€œOwner: Samuel, Make: Toyota, Model: Camry, Year: 2020, Speed: 75, Fuel Level: 0.70â€.â€¢A set of getters and setters for all Instance Properties. Look at the Week 3and 4Lecture Code for examples.Class CarDriver: Create a class named CarDriverto test your Carclass. The CarDriver class contains the mainmethod to run your program. In this class, you have to test all the public interface methods of the Car class including constructors, getters, and setters. You may create multiple objects of the Car class for testing. When testing, you must make sure that you think about all possible scenarios for each of the methods. For example, when you test the accelerate() method, besides checking to see whether a car can accelerate in a normal scenario, you need to think about what are called edge cases. That is, 1) there is not enough fuel,
2) the speed is already at the maximum, 3) the engine is off, etc. Also, you need to think about scenarios where setter methods must throw an IllegalArgumentException.