Introduction
Alongside the many other improvements in Java 8 (such as the streaming API, method references, optionals, and collectors) there are interface improvements that allow default and static methods known as functional interfaces. These are interfaces with one single abstract method, which enables their transformation into lambdas. You can read more about this in Chapter 13, Functional Programming with Lambda Expressions.
There are a total of 43 unique functional interfaces in the java.util.function
package; most of them are variants of the same kind of interface, albeit with different data types. In this chapter, we'll introduce you to the predicate functional interface, along with a few other selected interfaces.
Here, you'll find that many of the functional interfaces operate in very similar ways, often just replacing the type of data that the interface can operate on.