Skip to content

Instantly share code, notes, and snippets.

@mateuszmrozewski
Created August 16, 2019 08:09
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 mateuszmrozewski/c88092e98294b2b4ddaff8b20a02ec70 to your computer and use it in GitHub Desktop.
Save mateuszmrozewski/c88092e98294b2b4ddaff8b20a02ec70 to your computer and use it in GitHub Desktop.
Example of functional interfaces in streams
Stream.generate(() -> Math.random())
.mapToLong(x -> (long) (x * 10))
.filter(x -> x % 2 == 0)
.limit(10)
.forEach(System.out::println);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment