Tuesday, April 30, 2019

Java Streams

Null elements in the stream

I thought, I saw a statement that Java streams filters out the null elements in the stream but the information must have been wrong.  So, if nulls are expected, or just in case, do:

... .filter(Objects::nonNull). ....

No comments: