public static <U> CompletableFuture<U> failedFuture (Throwable ex)

Returns a new CompletableFuture that is already completed exceptionally with the given exception.

Parameters:
ex    the exception
<U>    the type of the value

Returns:  the exceptionally completed CompletableFuture

Since:  9