It can be done quickly in Java 8.
Map<String, Long> sortedByCountSet = Stream.of("One", "One", "One", "Two", "Three", "Three")
.collect(Collectors.groupingBy(str->str,TreeMap::new,Collectors.counting()));
System.out.println(sortedByCountSet);
Output here :-
{One=3, Three=2, Two=1}
OR
Map<String, Long> sortedByCountSet = Stream.of("One", "One", "One", "Two", "Three", "Three","Five","Five")
.collect(Collectors.groupingBy(str->str, Collectors.counting()))
.entrySet().stream().sorted(Comparator.comparing(Map.Entry::getValue))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,(e1, e2) -> e1,LinkedHashMap::new));
Output:-
{Two=1, Five=2, Three=2, One=3}