@Override
    public void onCompletion(Throwable error, U result) {
        synchronized (this) {
            if (isDone()) {
                return;
            }
            
            if (error != null) {
                this.exception = error;
            } else {
                this.result = convert(result);
            }

            if (underlying != null)
                underlying.onCompletion(error, this.result);
            finishedLatch.countDown();
        }
    }
An abstract implementation of {@link Callback} that also implements the {@link Future} interface. This allows for
operations like waiting until the callback is completed via {@link #onCompletion(Throwable, Object)}. The result
from the callback can be converted by concrete implementations of this class before being retrieved via
{@link Future#get}.
@param <U> the callback result type
@param <T> the future result type obtained after converting the callback result
connect/runtime/src/main/java/org/apache/kafka/connect/util/ConvertingFutureCallback.java