I have an ArrayList of objects Foo(int id, Date date)
.
How would i go about sorting this ArrayList to look something like below
id = 3, date = 07 Nov 2016
id = 2, date = 08 Nov 2016
id = 5, date = 30 Nov 2016
id = 1, date = 05 Nov 2016
id = 4, date = 04 Nov 2016
The top three objects are in the future sorted by closest (to the present) first, bottom two are in the past sorted by closest (to the present) first.