public static Constructor<?> findConstructor(Class<?> clazz, Class<?>... parameters) {
        for (Constructor<?> c : clazz.getConstructors())
            if (Arrays.equals(c.getParameterTypes(), parameters))
                return c;
        if (clazz.getSuperclass() != null)
            return findConstructor(clazz.getSuperclass(), parameters);
        return null;
    }