public static <T> BiFunction<T, Throwable, T> copyTo(CompletableFuture<T> dest) {
		return (t, ex) -> {
			if (ex != null) {
				dest.completeExceptionally(ex);
				return ExceptionUtils.rethrow(ex);
			}
			dest.complete(t);
			return t;
		};
	}
Create a {@link BiFunction} that copies a result from one {@link CompletableFuture} to
another

<p>
The returned function is suitable for use in {@link CompletableFuture#handle(BiFunction)} and
related methods, as in:

<pre>
sourceCF().handle(AsyncUtils.copyTo(destCF));
</pre>

<p>
This will effectively cause {@code destCF} to be completed identically to {@code sourceCF}.
The returned future from {@code handle} will also behave identically to {@code source CF},
except that {@code destCF} is guaranteed to complete before the returned future does.

@param <T> the type of the future result
@param dest the future to copy into
@return a function which handles the source future
Ghidra/Framework/Generic/src/main/java/ghidra/async/AsyncUtils.java