public static < T > T findAny ( Stream < T > stream , Predicate < T > predicate ) { Optional < T > element = stream . filter ( predicate ) . findAny ( ) ; return element . orElse ( null ) ; }
Find an element in the stream .