public Rental getRented() { for (Rental rent : rentals) { if (rent.isActive()) { return rent; } } return null; }
public boolean clearRented() { for (Rental rent : rentals) { if (rent.isActive()) { rent.clearRented(); return true; } } return false; }
// Methods public boolean isAvailable() throws NullPointerException { // if ( rentals != null) for (Rental rent : rentals) { if (rent.isActive()) { return false; } } return true; }