Skip to content

Instantly share code, notes, and snippets.

@shelajev
Created June 26, 2018 12:36
Show Gist options
  • Select an option

  • Save shelajev/017557c98bb10f1a3d9b7ec0c2f33608 to your computer and use it in GitHub Desktop.

Select an option

Save shelajev/017557c98bb10f1a3d9b7ec0c2f33608 to your computer and use it in GitHub Desktop.
Parallel-Streams.java
return Arrays.stream(values).parallel()
.map(x -> x + 1)
.map(x -> x * 2)
.map(x -> x + 5)
.reduce(0, Double::sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment