public void bookRoom(int roomNumber) throws Exception {

    var room = hotelDao.getById(roomNumber);

    if (room.isEmpty()) {
      throw new Exception("Room number: " + roomNumber + " does not exist");
    } else {
      if (room.get().isBooked()) {
        throw new Exception("Room already booked!");
      } else {
        var updateRoomBooking = room.get();
        updateRoomBooking.setBooked(true);
        hotelDao.update(updateRoomBooking);
      }
    }
  }
@Test
  void bookingRoomShouldChangeBookedStatusToTrue() throws Exception {
    hotel.bookRoom(1);
    assertTrue(dao.getById(1).isPresent());
    assertTrue(dao.getById(1).get().isBooked());
  }