AsyncFunctionReturnsNull
AsyncFunction should not return a null Future, only a Future whose result is null.

Severity
ERROR

The problem

Methods like Futures.transformAsync and Futures.catchingAsync will throw a NullPointerException if the provided AsyncFunction returns a null Future. To produce a Future with an output of null, instead return immediateFuture(null).

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AsyncFunctionReturnsNull") to the enclosing element.