I have a HashMap<String, Integer>
How can I sort this data structure and keep the key-value mappings? I want to sort by VALUES not keys.
Collection<Integer> counts = tableFrequency.values();
But then I lose the key mappings. Or is there a better associative data-structure that I could have used instead of the HashMap?