List<seats> seatCopy = new ArrayList<>(mySeatsList);
Please note that it just a shallow copy meaning the contents in the seatCopy ArrayList are exactly the same seat objects that were there mySeatsList Arraylist. Both lists point to the exact same objects.
Other methods that are provided by collections framework that can be applied to ArrayList are Collections.reverse(seatCopy),Collections.shuffle(seatCopy),Collections.sort(seatCopy)
Please note all these methods sort the actual list so after we apply the above methods and print our seat Copy ,it created different(reversed,shuffled or sorted list) as compared to the myseatsList.The actual elements (seat objects in our case are the same) in both the lists
Another method is Collections.copy ,which takes two arguments a destination and a source.Destination is a generic type which can be a Collection, Iterable or List and source is an actual list itself like ArrayList.
The problem with this approach is if destination collection does not has same amount of size as source list then the copy will fail.
So if we try something like this that is create a List named newCopy that points to a ArrayList which has size equal to mySeatsList and then if we try to copy the mySeatsList into it we will get Exception in thread "main" java.lang.IndexOutOfBoundsException: Source does not fit in destination.So even if we defined the newCopy as same size as mySeatsList it is still complaining about the size what that means is unless we actually instantiate the new list and fill it with all the objects and then try to copy the old list into this new list the copy wont work.so this method and is rarely used.
Then to find min and max items in a List.Please note min and max methods on Collections will also sort the lists while finding min and max objects in the list
Seat minseat = Collections.min(seatCopy);
Seat maxseat Collections.max(seatCopy);
Collections.max will also sort the list and return the max seat after