/** * Returns an {@link OptionalInt} describing the first element of this * stream, which matches given predicate, or an empty {@code OptionalInt} if * there's no matching element. * * <p> * This is a short-circuiting terminal operation. * * @param predicate a * <a href="package-summary.html#NonInterference">non-interfering * </a>, <a href="package-summary.html#Statelessness">stateless</a> * predicate which returned value should match * @return an {@code OptionalInt} describing the first matching element of * this stream, or an empty {@code OptionalInt} if there's no * matching element * @see #findFirst() */ public OptionalInt findFirst(IntPredicate predicate) { return filter(predicate).findFirst(); }