I\'m attempting to retrieve n unique random elements for further processing from a Collection using the Streams API in Java 8, however, without much or any luck.
Mor
It should be clear that streaming the collection is not what you want.
Use the generate() and limit methods:
generate()
limit
Stream.generate(() -> list.get(new Random().nextInt(list.size())).limit(3).forEach(...);