public static Method methodLookup(Class<?> klass, String methodName, Class<?>... parameterTypes) {
        try {
            return klass.getMethod(methodName, parameterTypes);
        } catch (ReflectiveOperationException | SecurityException e) {
            try {
                return klass.getDeclaredMethod(methodName, parameterTypes);
            } catch (ReflectiveOperationException | SecurityException e2) {
                e.addSuppressed(e2);
            }
            throw new IllegalStateException(format("can't find %s#%s%s", klass.getName(), methodName, Arrays.asList(parameterTypes)), e);
        }
    }
Lookup a specific method name related to a class. This helper tries {@link Class#getMethod(String, Class[])} first, then
falls back to {@link Class#getDeclaredMethod(String, Class[])}.

@param klass          A class
@param methodName     A method name
@param parameterTypes All parameter types for the method
@return A {@link Method} object
@throws IllegalStateException If the method could not be found
core/src/main/java/org/jdbi/v3/core/internal/JdbiClassUtils.java