private <R, E, X extends Exception> R callWithExtension(Class<E> extensionType,
                                                            ExtensionCallback<R, E, X> callback,
                                                            HandleSupplier handleSupplier) throws X {
        E extension = getConfig(Extensions.class)
            .findFor(extensionType, handleSupplier)
            .orElseThrow(() -> new NoSuchExtensionException(extensionType));

        return callback.withExtension(extension);
    }
A convenience method which opens an extension of the given type, yields it to a callback, and returns the result
of the callback. A handle is opened if needed by the extension, and closed before returning to the caller.

@param extensionType the type of extension.
@param callback      a callback which will receive the extension.
@param <R> the return type
@param <E> the extension type
@param <X> the exception type optionally thrown by the callback
@return the value returned by the callback.
@throws NoSuchExtensionException if no {@link ExtensionFactory} is registered which supports the given extension
                                 type.
@throws X                        if thrown by the callback.
core/src/main/java/org/jdbi/v3/core/Jdbi.java