We had a data structure that looked something like this:
Map<String, Double> responseMap;
And were sorting this map in descending order based on value as:
responseMap.entrySet().stream()
.sorted((Map.Entry.<String, Double>comparingByValue().reversed()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
(e1, e2) -> e1, LinkedHashMap::new));
Now the data structure of this map changed to something like:
Map<String, Tuple2<Double, Integer> responseMap; //org.jooq.lambda.tuple.Tuple2
How can we sort this map on the new value (based on the Double value and Integer) cleanly?