code: @Nullable
    public static Method getMethodByName(Class<?> clazz, String name) {
      for (Method method : clazz.getMethods())
        if (method.getName().equals(name))
          return method;
  
      return null;
    }
docs: Finds a public method with the given name declared in the given
  class/interface or one of its super classes/interfaces. If multiple such
  methods exists, it is undefined which one is returned.