@ SafeVarargs @ Nonnull public static < T > T findFirstNonNull ( @ Nonnull final T ... objects ) { for ( final T obj : ensureNonNull ( objects ) ) { if ( obj != null ) { return obj ; } } throw Assertions . fail ( "Can't find non-null item in array" ) ; }
Find the first non - null value in an array and return that .