public static void unBook(int bookingId){ for(Customer c : customerArray){ for(Booking b : c.BookingArray){ if(bookingId==b.bookingID){Iterator it = c.BookingArray.iterator(); while(it.hasNext()) { it.remove(); } } } } }