I have two ArrayList as follows:
ArrayList
original: 12, 16, 17, 19, 101
12, 16, 17, 19, 101
selected: 16, 19, 107, 108, 109
16, 19, 107, 108, 109
Intersection: original.retainAll(selected).
original.retainAll(selected)
After that original will contain only elements present in both collections. Returns true if anything changed.
WARNING: This method is very slow for large collections