code: static @Nullable <V> V getWhenSuccessful(@Nullable CompletableFuture<V> future) {
      try {
        return (future == null) ? null : future.get();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        return null;
      } catch (ExecutionException e) {
        return null;
      }
    }
docs: Returns the value when completed successfully or null if failed.