Java common operations
List
List Reverse
1  | List<Integer> list = new ArrayList<>();  | 
List contains
1  | List<Integer> ans = new ArrayList<>();  | 
List Shallow clone
For the reference data type, the copy is its reference, and a new object is not created, that is, no new memory space is allocated. Such a copy is called a shallow copy.

Shallow copy of list A to list B is to directly copy the content of A to B,so A and B point to the same address. The consequence is that changing B will also change A, because changing B is changing the content of the address pointed to by B.
1  | //origin list  | 
List deep clone
Deep copy is to copy A to B at the same time, create a new address for B, and then transfer the content of address A to address B. The contents of ListA and ListB are the same, but because they point to different addresses, the changes will not affect each other.

1  | //--------1. Serialization  |