private static boolean areMethodNameAndParameterTypesEqual(Method methodA, Method methodB) {
        if (!methodA.getName().equals(methodB.getName())) {
            return false;
        }
        Class<?>[] methodAParameterTypes = methodA.getParameterTypes();
        Class<?>[] methodBParameterTypes = methodB.getParameterTypes();
        if (methodAParameterTypes.length != methodBParameterTypes.length) {
            return false;
        }
        for (int i = 0; i < methodAParameterTypes.length; i++) {
            if (!methodAParameterTypes[i].equals(methodBParameterTypes[i])) {
                return false;
            }
        }

        return true;
    }
private static boolean areMethodNameAndParameterTypesEqual ( Method methodA , Method methodB ) { if ( ! methodA . getName ( ) . equals ( methodB . getName ( ) ) ) { return false ; } Class < ? > [ ] methodAParameterTypes = methodA . getParameterTypes ( ) ; Class < ? > [ ] methodBParameterTypes = methodB . getParameterTypes ( ) ; if ( methodAParameterTypes . length != methodBParameterTypes . length ) { return false ; } for ( int i = 0 ; i < methodAParameterTypes . length ; i ++ ) { if ( ! methodAParameterTypes [ i ] . equals ( methodBParameterTypes [ i ] ) ) { return false ; } } return true ; }
Compares to methods for equality based on name and parameter types.