I got the following situation:
I have a list of unsorted keys and a different list of String terms. Both are connected in a way, meaning it looks kinda like this:
1 contents
5 term
2 queue
etc.
This list now contains 1000+ entries and I want to find a fast way to sort these two lists in descending order but of course I need the persistent connection to the strings.
5 term
2 queue
1 contents
I thought about putting the keys and values in a TreeMap, but the thing is, there can be duplicate keys, and I want to preserve them. Any ideas on this?