@SuppressWarnings("unchecked")
    public static <T> MethodHandleHolder<T> findConstructor(Class<T> type, Class<?>... types) {

        var ctorHandle = findCtorMethodHandleForParameters(type, types);
        return invoker -> {
            try {
                return (T) invoker.createInstance(ctorHandle);
            } catch (Throwable t) {
                throw throwAnyway(t);
            }
        };
    }
Inspect a type and find a matching constructor. The method tries to match as many parameters as possible
to the available constructors, cutting off parameters from the end one-by-one until a matching constructor is found.

@param type  The type that should be instantiated.
@param types Array of parameter types.
@return a handle to the found constructor, with the argument list adjusted to drop excess parameters
core/src/main/java/org/jdbi/v3/core/internal/JdbiClassUtils.java