Chapter 8. Processing Massive Datasets with Parallel Streams – The Map and Collect Model
In Chapter 7, Processing Massive Datasets with Parallel Streams – The Map and Reduce Model, we introduced the concept of stream, the new Java 8 feature. A stream is a sequence of elements that can be processed in a parallel or sequential way. In this chapter, you will learn how to work with streams with the following topics:
The
collect()
methodThe first example – searching data without indexing
The second example – a recommendation system
The third example – common contacts in a social network