Reversing a List in Java - In-Place and Out-Of-Place
Note:Theclone()methoddoesn'tcreate a deep copy. Creating a list usingnew ArrayList<>(list)doesn'tcreate a deep copy. Creating deep copies is discouraged, and surprisingly difficult to do in a generic way (and d