public static <T> void propagateResult(
      final CompletionStage<T> from, final CompletableFuture<T> to) {
    from.whenComplete(
        (value, error) -> {
          if (error != null) {
            to.completeExceptionally(error);
          } else {
            to.complete(value);
          }
        });
  }
Propagates the result of one {@link CompletionStage} to a different {@link CompletableFuture}.

<p>When <code>from</code> completes successfully, <code>to</code> will be completed
successfully with the same value. When <code>from</code> completes exceptionally, <code>to
</code> will be completed exceptionally with the same exception.

@param <T> the type of the success value
@param from the CompletionStage to take results and exceptions from
@param to the CompletableFuture to propagate results and exceptions to
util/src/main/java/org/hyperledger/besu/util/FutureUtils.java