code: private static <T> void acceptResult(CompletableCompletionStage<T> s, Supplier<? extends T> supplier) {
          try {
              // exception can be thrown only by supplier. All callbacks are generated by us and they do not throw any exceptions
              s.complete(supplier.get());
          } catch (Throwable e) {
              handleFailure(s, e);
          }
      }
docs: Accepts result provided by the Supplier. If an exception is thrown by the supplier, completes exceptionally.
  
  @param supplier generates result