@Nullable
  public static Method getMethodByName(Class<?> clazz, String name) {
    for (Method method : clazz.getMethods())
      if (method.getName().equals(name))
        return method;

    return null;
  }
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.
spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java