I have defined a dictionary :
Map<String, Integer>
Then in the code, I am adding entries to the collection :
map.put("> 80", // some stream() + lambda based logic for calculating the value part);
map.put("60 - 80", ....);
map.put("40 - 60", ....);
map.put("20 - 40", ....);
map.put(" < 40", ....);
Later in the debug mode, I see that the ordering of the keys have changed. For e.g. "20 -40" is first, "60- 80" is last. Why is the ordering of keys changing? How can I maintain the ordering of keys in the collection.