In this recipe, we used three different methods to verify conditions over the elements of a Stream:
- allMatch(): This method is a terminal operation that receives as parameter an implementation of the Predicate interface expressed as a lambda expression or as an object that implements it and returns a Boolean value. It returns true if the Predicate introduced is true for all the elements of the Stream and false otherwise.
- anyMatch(): This method is a terminal operation that receives as parameter an implementation of the Predicate interface expressed as a lambda expression or as an object that implements it and returns a Boolean value. It returns true if the Predicate introduced is true for at least one of the elements of the ...