PriorityQueue<Pair<String, Integer>> pq = new PriorityQueue<>(
(a,b) -> a.getValue()==b.getValue() ? b.getKey().compareTo(a.getKey()) : a.getValue()-b.getValue()
);
eg. want to sort this {"love":2,"coding":1,"i":2,"leetcode":1} with result as {"i":2,"love":2,"coding":1,"leetcode":1} but the output result is [love=2, coding=1, i=2, leetcode=1]
Can someone help explain why is it?