private static void collectFields(@NotNull Class<?> clazz, @NotNull List<? super Field> result) {
    result.addAll(Arrays.asList(clazz.getDeclaredFields()));

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

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