There's more...

You can obtain an implementation of the Spliterator interface from different data sources. The BaseStream class provides the spliterator() method that returns a Spliterator from the elements of the Stream. Other data structures, such as ConcurrentLinkedDeque, ConcurrentLinkedQueue, or Collection, also provide the spliterator() method to get an implementation of that interface to process the elements of those data structures.

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.