CHAPTER 7
LAMBDAS AND STREAMS
200
If one of the standard functional interfaces does the job, you should generally
use it in preference to a purpose-built functional interface.
This will make
your API easier to learn, by reducing its conceptual surface area, and will provide
significant interoperability benefits, as many of the standard functional interfaces
provide useful default methods. The
Predicate
interface, for instance, provides
methods to combine predicates. In the case of our
LinkedHashMap
example, the
standard
BiPredicate