code: public static Method[] collectMethods(Class<?> clazz, String name) {
          final List<Method> result = new ArrayList<>();
          for (Method m: clazz.getMethods()) {
              if (m.getName().equals(name)) result.add(m);
          }
          return result.toArray(new Method[result.size()]);
      }
docs: Collects all public methods of {@code clazz} with the given {@code name}.
  @param clazz
  @param name
  @return methods