class ReflectionUtils {

    public static Method findAssociatedMethod(Object ruleClass, String methodName) throws NoSuchMethodException {
        Method[] methodArr = ruleClass.getClass().getDeclaredMethods();
        for (Method method : methodArr) {
            if (methodName.equals(method.getName())) {
                return method;
            }
        }
        // if control is here that means no execute method found in the class
        throw new NoSuchMethodException("unable to find  "+ methodName +" method");
    }

}