Skip to content

Instantly share code, notes, and snippets.

@gabfssilva
Created September 6, 2017 23:59
Show Gist options
  • Save gabfssilva/bc1395b03b4d8508c07dad8e37edaf5f to your computer and use it in GitHub Desktop.
Save gabfssilva/bc1395b03b4d8508c07dad8e37edaf5f to your computer and use it in GitHub Desktop.
parallelStream
Stream<Integer> xs = Stream.of(5, 3, 7, 3, 2, 7);
final List<Integer> range = IntStream.range(0, 100).boxed().collect(toList());
final List<List<Integer>> result =
range
.parallelStream()
.map(e -> xs.sorted().collect(toList()))
.collect(toList());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment