public static < T > Stream < T > ofSingleNullable ( T nullable ) { return null == nullable ? Stream . empty ( ) : Stream . of ( nullable ) ; }
Converts nulls into an empty stream and non - null values into a stream with one element .