try Find
Returns an Optional containing the first element in this that satisfies the given predicate, if such an element exists.
Warning: avoid using a predicate that matches null. If null is matched in this, a NullPointerException will be thrown.
Stream equivalent: stream.filter(predicate).findFirst()
See also
Returns an Optional containing the first element in this that satisfies the given predicate, if such an element exists. If no such element is found, an empty Optional will be returned from this method and the iterator will be left exhausted: its hasNext method will return false.
Warning: avoid using a predicate that matches null. If null is matched in this, a NullPointerException will be thrown.