code: public static List<Field> getAllFields(List<Field> fields, Class<?> clazz)
    {
      for (Field field : clazz.getDeclaredFields())
      {
        fields.add(field);
      }
  
      if (clazz.getSuperclass() != null)
      {
        fields = getAllFields(fields, clazz.getSuperclass());
      }
  
      return fields;
    }
docs: This static method will get ALL fields for this class, including any inherited ones.
  
  @param fields List&lt;Field&gt; - a list to use to add to
  @param clazz Class&lt;?&gt; - The Class to run the reflection on
  @return List&lt;Field&gt;