private static List<Method> findConcreteMethodsOnInterfaces(Class<?> clazz) {
        List<Method> result = null;
        for (Class<?> ifc : clazz.getInterfaces()) {
            for (Method ifcMethod : ifc.getMethods()) {
                if (!Modifier.isAbstract(ifcMethod.getModifiers())) {
                    if (result == null) {
                        result = new LinkedList<Method>();
                    }
                    result.add(ifcMethod);
                }
            }
        }
        return result;
    }
This variant retrieves {@link Class#getDeclaredMethods()} global a local cache
in order to avoid the JVM's SecurityManager check and defensive array copying.
In addition, it also includes Java 8 default methods global locally implemented
interfaces, since those are effectively to be treated just like declared methods.

@param clazz the class to introspect
@return the cached array of methods
@see Class#getDeclaredMethods()
android/android_framework/patch-magisk/bridge/src/main/java/github/tornaco/android/thanox/magisk/bridge/util/ReflectionUtils.java