diff --git a/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/BookingResponse.java b/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/BookingResponse.java index 19e87674..2d4f3b57 100644 --- a/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/BookingResponse.java +++ b/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/BookingResponse.java @@ -14,4 +14,8 @@ public BookingResponse(boolean confirmedStatus) { public boolean isConfirmed() { return confirmedStatus; } + + public boolean isOnWaitingList() { + return !confirmedStatus; + } } diff --git a/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/PetHotel.java b/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/PetHotel.java index 60363b06..a8b6ee73 100644 --- a/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/PetHotel.java +++ b/src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/PetHotel.java @@ -11,15 +11,31 @@ public class PetHotel { private Collection pets= new TreeSet<>(Comparator.comparing(Pet::getName)); public static int DEFAULT_MAXIMUM_CAPACITY = 20; + private Queue waitingList = new LinkedList<>(); public List getPets() { return new ArrayList(pets); } public BookingResponse checkIn(Pet pet) { + boolean confirmStatus= false; + if (pets.size() getWaitingList() { + return new ArrayList<>(waitingList); + } - if (pets.size()