public static Method getMethodByName(Class clazz, String methodName) {
        for (Method method : clazz.getDeclaredMethods()) {
            if (method.getName().equals(methodName)) {
                return method;
            }
        }
        return null;
    }
public static Method getMethodByName(Class clazz, String methodName) {
        for (Method method : clazz.getDeclaredMethods()) {
            if (method.getName().equals(methodName)) {
                return method;
            }
        }
        return null;
    }
public static Method getMethodByName ( Class clazz , String methodName ) { for ( Method method : clazz . getDeclaredMethods ( ) ) { if ( method . getName ( ) . equals ( methodName ) ) { return method ; } } return null ; }
Searches a method by name.

@param clazz      Class to scan
@param methodName Name of the method
@return the found method or <tt>null</tt> if no method was found
Searches a method by name .