Skip to content

Instantly share code, notes, and snippets.

@JHarry444
Created February 12, 2019 09:36
Show Gist options
  • Save JHarry444/641831f51050648d32d1da93856f7858 to your computer and use it in GitHub Desktop.
Save JHarry444/641831f51050648d32d1da93856f7858 to your computer and use it in GitHub Desktop.
List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
// list = list.stream().filter(x -> x % 2 != 0 && x > 6 && x < 9).collect(Collectors.toList());
// list = list.stream().map(x -> x * 10).collect(Collectors.toList());
// System.out.println(list.stream().reduce((x, y) -> Math.max(x, y)).get());
// list.stream().reduce(Math::max).get();
System.out.println(list);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment