I am trying to implement the following C#
code in Java
:
List<org.joda.time.DateTime> times;
...
foreach (var time in times.OrderBy(d = > d).Distinct())
...
I'm using Collections.sort()
to sort times
, but what's the best way to implement the Distinct()
method?