### Question:
Car { public void setPassedVehicleInspection(boolean passed) { this.passedVehicleInspection = passed; } Car(String manufacturer, String licencePlate, int seatCount); String getManufacturer(); void setManufacturer(String manufacturer); String getLicensePlate(); void setLicensePlate(String licensePlate); int getSeatCount(); void setSeatCount(int seatCount); boolean getPassedVehicleInspection(); void setPassedVehicleInspection(boolean passed); Driver getDriver(); void setDriver(Driver driver);  }### Answer:
@Test public void carIsRented() { RentalCar rentalCar = new RentalCar( "Morris", "DD-AB-123", 2 ); rentalCar.setPassedVehicleInspection( true ); rentalCar.setRented( true ); Set<ConstraintViolation<RentalCar>> constraintViolations = validator.validate( rentalCar ); assertEquals( 1, constraintViolations.size() ); assertEquals( "Wrong message", "The car is currently rented out", constraintViolations.iterator().next().getMessage() ); rentalCar.setRented( false ); constraintViolations = validator.validate( rentalCar ); assertEquals( 0, constraintViolations.size() ); }