docs: static Method getMethod(Class<?> cls, String name) throws NoSuchMethodException {
      NoSuchMethodException firstExc = null;
      for (Class<?> c = cls; c != null; c = c.getSuperclass()) {
        try {
          return c.getDeclaredMethod(name);
        } catch (NoSuchMethodException e) {
          if (firstExc == null) {
            firstExc = e;
          }
        }
      }
      throw firstExc;
    }