I have a list of dates and a current date. How can I find the date which is nearest to the current date?
If the list is sorted, then you can use Collections.binarySearch() to find the place where the given date would be sorted into the list - the closest one is either right after or right before that index.
For very large lists, this is much faster than the other solutions, but of course it does require the list to be sorted. If you're going to do such a query multiple times, it would be worth it (performance-wise) to sort the list first.