Skip to content

Instantly share code, notes, and snippets.

@mevsungur
Created August 6, 2020 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mevsungur/f7dcf4a608c6e8fec9a0efb26a7f175b to your computer and use it in GitHub Desktop.
Save mevsungur/f7dcf4a608c6e8fec9a0efb26a7f175b to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
LocalDate now = LocalDate.now();
List<LocalDate> isimList = Arrays.asList(now, null, now.minusDays(2), now.plusDays(3),
now.minusMonths(2), null, now.plusYears(1), null);
isimList.sort(Comparator.nullsLast(LocalDate::compareTo));
isimList.stream().forEach(System.out::println);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment