code: public static <T> boolean isSuccessful(CompletableFuture<T> f) {
          return f.isDone() && !f.isCompletedExceptionally() && !f.isCancelled();
      }
docs: Returns true if the future is done and successful.
  
  @param f   The future to inspect.
  @param <T> The Type of the future's result.
  @return True if the given CompletableFuture has completed successfully.