Summary
In this chapter, we were introduced to streams, a new feature introduced in Java 8 inspired by functional programming, and got ready to work with the new lambda expressions. A stream is a sequence of data (is not a data structure), which allows you to apply a sequence of operations in a sequential or concurrent way to filter, convert, sort, reduce, or organize those elements to obtain a final object.
You also learned the main characteristics of the streams that we have to take into account when we use streams in our sequential or concurrent applications.
Finally, we used streams in two samples. In the first sample, we used almost all the methods provided by the Stream
interface to calculate the statistical data of a large Dataset. We used the Bank Marketing dataset of the UCI Machine Learning Repository with its 45,211 records. In the second sample, we implemented different approaches to a search application in an inverted index to obtain the most relevant documents to a query. This...