public static <T> CompletableFuture<T> completedExceptionally(Throwable cause) {
    CompletableFuture<T> result = new CompletableFuture<>();
    result.completeExceptionally(cause);

    return result;
  }
Returns an exceptionally completed {@link CompletableFuture}.
@param cause to complete the future with
@param <T> type of the future
@return An exceptionally completed CompletableFuture
ambry-utils/src/main/java/com/github/ambry/utils/Utils.java