private static Method getMethod(Class<?> cl, String method) {
        for(Method m: cl.getMethods()) {
            if(m.getName().equals(method)) {
                return m;
            }
        }
        return null;
    }