docs: static Method getMethod(Class<?> type, Method m) {
          if (m == null || Modifier.isPublic(type.getModifiers())) {
              return m;
          }
          Class<?>[] inf = type.getInterfaces();
          Method mp = null;
          for (int i = 0; i < inf.length; i++) {
              try {
                  mp = inf[i].getMethod(m.getName(), m.getParameterTypes());
                  mp = getMethod(mp.getDeclaringClass(), mp);
                  if (mp != null) {
                      return mp;
                  }
              } catch (NoSuchMethodException e) {
                  // Ignore
              }
          }
          Class<?> sup = type.getSuperclass();
          if (sup != null) {
              try {
                  mp = sup.getMethod(m.getName(), m.getParameterTypes());
                  mp = getMethod(mp.getDeclaringClass(), mp);
                  if (mp != null) {
                      return mp;
                  }
              } catch (NoSuchMethodException e) {
                  // Ignore
              }
          }
          return null;
      }