public static <T> @NonNull CompletableFuture<T> failedFuture(final @NonNull Throwable throwable) {
        final CompletableFuture<T> future = new CompletableFuture<>();
        future.completeExceptionally(throwable);
        return future;
    }
Returns a failed future that has been exceptionally completed with the given {@code throwable}.

<p>This is equivalent to {@code CompletableFuture.failedFuture(Throwable)} that was introduced in Java 9.</p>

@param <T>       future type
@param throwable throwable to complete future with
@return the future
cloud-core/src/main/java/org/incendo/cloud/util/CompletableFutures.java