@ SafeVarargs public static < T > T coalesce ( final T ... things ) { if ( things == null || things . length == 0 ) { return null ; } for ( T thing : things ) { if ( thing != null ) { return thing ; } } return null ; }
Similar to SQL coalesce returns the first non - null argument