private static void collectMethods(@NotNull Class<?> clazz, @NotNull List<? super Method> result) {
    result.addAll(Arrays.asList(clazz.getDeclaredMethods()));

    Class<?> superClass = clazz.getSuperclass();
    if (superClass != null) {
      collectMethods(superClass, result);
    }

    for (Class<?> each : clazz.getInterfaces()) {
      collectMethods(each, result);
    }
  }
private static void collectMethods(@NotNull Class<?> clazz, @NotNull List<? super Method> result)