There are three classes: Car, Engine and Wheel. Make class Car immutable.
- Implement method
changeEngine(Engine engine)
, that will allow you to upgrade your car, and you will be like Vin Diesel:) - Implement method
changeColor(String newColor)
. - Implement method
addWheel(Wheel newWheel)
. Our car can have as many wheels as possible. Even 10 wheels)
You also should implement equals()
and hashCode()
methods and constructor with all arguments in all classes, in order for the tests to run correctly.