I have this Hashmap of floats and I want to get the top 5 largest values from it:

```
import java.util.Map;

HashMap<Float,Float> hm = new HashMap<Float,Float>();

// Putting key-value pairs in the HashMap
for (int i = 0; i < 100; i++) {

  float pos = random(-50, 50);
  float time = random(0, 50);
hm.put(time, pos);

}
// Using an enhanced loop to interate over each entry
for (Map.Entry me : hm.entrySet()) {
  print("key is " + me.getKey());
  println(" value is " + me.getValue());
}

```

I assume I would need to sort it first. Question is, how to sort it and will the keys still remain the same after the sort? When I say "same" I mean will the sorted values still have the original key identifier? This is crucial for what I am trying to accomplish.