I want to sort the below item according to number of occurrences
I am using
List<Gender> list = query.list();
Set<Gender> unique = new HashSet<Gender>(list);
for (Gender key : unique) {
System.out.println(key + ": " + Collections.frequency(list, key));
}
But above logic is giving the same sequence as frequency is counted based on complete list not based on AssignedTo. I want to find frequency and then sort the list based on frequency.
And all these info are stored in list now.