I have a TreeMap
like so:
{
"one": "First option",
"two": "Second option",
"three": "Third option",
"four": "Last option"
}
I want to resort this object so that the output is like this:
{
"four": "First option",
"three": "Second option",
"two": "Third option",
"one": "Last option"
}
I was looking at some of the commons collections utilities from apache, but did not see anything immediately that would do the trick.
What is the cleanest way to write this without a bunch of loops?