@Override
    @SuppressWarnings("PMD.UnnecessaryCast")
    public Optional<ExtensionHandler> createExtensionHandler(Class<?> extensionType, Method method) {

        List<Class<?>> extensionAnnotations = findAnnotations(method);

        if (extensionAnnotations.size() > 1) {
            throw new IllegalStateException(
                    format("Mutually exclusive extension annotations on method %s.%s: %s",
                            extensionType.getName(),
                            method.getName(),
                            extensionAnnotations));
        }

        if (method.isDefault() && !method.isSynthetic()) {
            throw new IllegalStateException(format(
                    "Default method %s.%s has @%s annotation. "
                            + "Extension type methods may be default, or have a @UseExtensionHandler annotation, but not both.",
                    extensionType.getSimpleName(),
                    method.getName(),
                    extensionAnnotations.get(0).getSimpleName()));
        }

        return extensionAnnotations.stream()
                .map(type -> type.getAnnotation(UseExtensionHandler.class))
                .map(UseExtensionHandler::value)
                .map(klass -> (ExtensionHandler) JdbiClassUtils.findConstructorAndCreateInstance(klass, EXTENSION_HANDLER_TYPES,
                        handle -> handle.invokeExact(extensionType, method)))
                .findFirst();
    }
Processes {@link UseExtensionHandler} annotations on methods.
core/src/main/java/org/jdbi/v3/core/extension/UseAnnotationExtensionHandlerFactory.java