private Method getMethodOfClassByName(Class cls, String name) {
        for (Method method : cls.getMethods()) {
            if (method.getName().equals(name)) {
                return method;
            }
        }
        return null;
    }