But that function is sadly not available for Reactor’s Flux. And in my somewhat uncommon example the null check is not releated to elements of the stream. The actual code looks like this:
It is the declaration of filter(...) that specifies the return type. What happens in the code passed to it cannot have any influence on the declared type.
If you need this, you can easily add an extension function (based on filterNotNull()) to Flux.