In Java, I have for example the following list:
List<String> testList = Arrays.asList["jack","john","john","rick","rick","rick"]
And I want to pick those repeated and show only one with the number of repetitions.
Output:
jack
john (x2)
rick (x3)