code: public static List<Field> getAnnotatedFields(final Class<?> cls, final Class<? extends Annotation> annotationClass) {
  
          final List<Field> fieldList = new ArrayList<>();
  
          for (final Field f : cls.getDeclaredFields()) {
              if (f.getAnnotation(annotationClass) != null) {
                  fieldList.add(f);
              }
          }
  
          // Add super class methods
          if (cls.getSuperclass() != null) {
              fieldList.addAll(getAnnotatedFields(cls.getSuperclass(), annotationClass));
          }
  
          return fieldList;
      }
docs: Retrieve all annotation of the given type from the given class.
  
  @param cls the class that we want to inspect
  @param annotationClass the type of Annotation to find
  
  @return the list of annotated fields