You have two hashmaps HM1 and HM2 where key = Id(long) value = timestamp. You need to give a program to return a list of Ids combined from both the hashmaps such that they are sorted as per their timestamps.
My Solution: a. Wrap the object timestamp and id, in another object. Write a comparator on the basis of timestamp of the object, sort the list of objects and return the ids.
Any more intelligent way to do it?
ArrayListofMap.Keywhich works quite well as aPair