goja-core/src/main/java/goja/core/kits/reflect/ClassKit.java
public static int getMethodCountForName(Class<?> clazz, String methodName) {
        Preconditions.checkNotNull(clazz, "Class must not be null");
        Preconditions.checkNotNull(methodName, "Method name must not be null");
        int count = 0;
        Method[] declaredMethods = clazz.getDeclaredMethods();
        for (Method method : declaredMethods) {
            if (methodName.equals(method.getName())) {
                count++;
            }
        }
        Class<?>[] ifcs = clazz.getInterfaces();
        for (Class<?> ifc : ifcs) {
            count += getMethodCountForName(ifc, methodName);
        }
        if (clazz.getSuperclass() != null) {
            count += getMethodCountForName(clazz.getSuperclass(), methodName);
        }
        return count;
    }
public static int getMethodCountForName(Class<?> clazz, String methodName) {
        Preconditions.checkNotNull(clazz, "Class must not be null");
        Preconditions.checkNotNull(methodName, "Method name must not be null");
        int count = 0;
        Method[] declaredMethods = clazz.getDeclaredMethods();
        for (Method method : declaredMethods) {
            if (methodName.equals(method.getName())) {
                count++;
            }
        }
        Class<?>[] ifcs = clazz.getInterfaces();
        for (Class<?> ifc : ifcs) {
            count += getMethodCountForName(ifc, methodName);
        }
        if (clazz.getSuperclass() != null) {
            count += getMethodCountForName(clazz.getSuperclass(), methodName);
        }
        return count;
    }
public static int getMethodCountForName ( Class < ? > clazz , String methodName ) { Preconditions . checkNotNull ( clazz , "Class must not be null" ) ; Preconditions . checkNotNull ( methodName , "Method name must not be null" ) ; int count = 0 ; Method [ ] declaredMethods = clazz . getDeclaredMethods ( ) ; for ( Method method : declaredMethods ) { if ( methodName . equals ( method . getName ( ) ) ) { count ++ ; } } Class < ? > [ ] ifcs = clazz . getInterfaces ( ) ; for ( Class < ? > ifc : ifcs ) { count += getMethodCountForName ( ifc , methodName ) ; } if ( clazz . getSuperclass ( ) != null ) { count += getMethodCountForName ( clazz . getSuperclass ( ) , methodName ) ; } return count ; }
Return the number of methods with a given name (with any argument types),
for the given class and/or its superclasses. Includes non-public methods.

@param clazz      the clazz to check
@param methodName the name of the method
@return the number of methods with the given name
Return the number of methods with a given name ( with any argument types ) for the given class and / or its superclasses . Includes non - public methods .