0

or put it in another way, perform stream.forEach() in random order. (without using calling .collect() first)

  • 1
    “without calling collect”… you could use `sorted(…)` with a [shuffling comparator](https://stackoverflow.com/a/29251881/2711488) – Holger Jun 04 '21 at 16:29
  • Is this really a duplicate of the other question? The other question is about generating a randomized range of integers; this one seems more general - how to create a shuffled stream. – Ron McLeod Jun 05 '21 at 20:03

0 Answers0