I have situation where there is a HashMap as
Map<Integer,ArrayList> key = new HashMap<Integer,ArrayList>()
;
The array list has [rankOfCard,suitOfCard]
I want to sort this Map in such a way that If the value is
(1,[3,1])
(2,[2,4])
(3,[1,3])
(4,[1,2])
(5,[2,3])
Output should be :
(4,[1,2])
(3,[1,3])
(5,[2,3])
(2,[2,4])
(1,[3,1])
How can I achieve this ?