code: public static <T> CompletableFuture<T> failedFuture(Throwable exception) {
          CompletableFuture<T> result = new CompletableFuture<>();
          result.completeExceptionally(exception);
          return result;
      }
docs: Creates a new CompletableFuture that is failed with the given exception.
  
  @param exception The exception to fail the CompletableFuture.
  @param <T>       The Type of the future's result.
  @return A CompletableFuture that fails with the given exception.