code: public static List<Field> getDeclaredFields(Class<?> cls) {
          if (cls == null || Object.class.equals(cls)) {
              return Collections.emptyList();
          }
          final List<Field> fields = new ArrayList<Field>();
          final Set<String> fieldNames = new HashSet<String>();
          for (Field field : cls.getDeclaredFields()) {
              fields.add(field);
              fieldNames.add(field.getName());
          }
          for (Field field : getDeclaredFields(cls.getSuperclass())) {
              if (!fieldNames.contains(field.getName())) {
                  fields.add(field);
              }
          }
          return fields;
      }
docs: Returns the list of declared fields from the class <code>cls</code> and its superclasses
  excluding <code>Object</code> class. If the field from child class hides the field from superclass,
  the field from superclass won't be added to the result list.
  
  @param cls is the processing class
  @return list of Fields