concurrent/src/main/java/io/airlift/concurrent/MoreFutures.java
public static <T> void mirror(ListenableFuture<? extends T> source, SettableFuture<? super T> destination, boolean mayInterruptIfRunning)
    {
        FutureCallback<T> callback = new FutureCallback<T>()
        {
            @Override
            public void onSuccess(@Nullable T result)
            {
                destination.set(result);
            }

            @Override
            public void onFailure(Throwable t)
            {
                destination.setException(t);
            }
        };
        Futures.addCallback(source, callback, directExecutor());
        propagateCancellation(destination, source, mayInterruptIfRunning);
    }
public static <T> void mirror(ListenableFuture<? extends T> source, SettableFuture<? super T> destination, boolean mayInterruptIfRunning)
    {
        FutureCallback<T> callback = new FutureCallback<T>()
        {
            @Override
            public void onSuccess(@Nullable T result)
            {
                destination.set(result);
            }

            @Override
            public void onFailure(Throwable t)
            {
                destination.setException(t);
            }
        };
        Futures.addCallback(source, callback, directExecutor());
        propagateCancellation(destination, source, mayInterruptIfRunning);
    }
Mirrors all results of the source Future to the destination Future.
<p>
This also propagates cancellations from the destination Future back to the source Future.