A Java list has repeated elements like
[cat, apple, iphone, football, apple, adam, apple, football, cat, people, cat]
- catrepeated 3 times
- footballrepeated 2 times
- applerepeated 3 times
How to extract only the repeated elements from the list such that the final list has
[cat, apple, football]?
 
     
     
     
     
     
     
    