1. Overview
In this example tutorial, We'll be learning Java 8 IntStream API anyMatch() method to verify Predicate condition matches to any values in the IntStream.
In the last tutorial, We've seen how to check whether all elements are matched to predicate condition using allmatch() method.
Let us see anyMatch() syntax, Example programs on this method.
API Note:
Returns whether any elements of this stream match the provided predicate. May not evaluate the predicate on all elements if not necessary for determining the result. If the stream is empty then false is returned and the predicate is not evaluated.