public static < U > CompletableFuture < U > failedFuture ( Throwable ex ) { return new CompletableFuture < U > ( new AltResult ( Objects . requireNonNull ( ex ) ) ) ; }
Returns a new CompletableFuture that is already completed exceptionally with the given exception .