If you want to discuss the implementation of a new algorithm for this (instead of using the lovely apache commons code), you can rest assured I won't be as fast as electricity ..
let's see... can we use something other than a hashmap?
I can think of storing Map.Entry objects (if the HashMap object is already given to you, get the Entry object Set using the appropriate method)
in a List and sorting that list by using a custom Comparator which helps sort by Entry values.
Hope I am clear with the basic idea, but this is just a thought running in my head and I haven't considering all aspects of implementing it, but maybe you want to try some code taking this as a cue and we can discuss it further?