private boolean isWithinPriceRange(Traveller traveller, Accommodation accommodation) { PriceRange priceRange = traveller.getPriceRange(); int price = accommodation.getPrice(); if (price >= priceRange.getMin() && price <= priceRange.getMax()) { return true; } return false; }
private boolean meetRequirements(Traveller traveller, Accommodation accommodation) { boolean requirementSatisfied = false; for (String requirement : traveller.getRequirements()) { if (accommodation.getAttributes().contains(requirement)) { requirementSatisfied = true; } else { return false; } } return requirementSatisfied; }