code: public static List<Class<?>> getParameterizedType(final Class<?> ownerClass,
              Class<?> genericSuperClass) {
          Type[] types = null;
          if (genericSuperClass.isInterface()) {
              types = ownerClass.getGenericInterfaces();
          } else {
              types = new Type[] { ownerClass.getGenericSuperclass() };
          }
  
          List<Class<?>> classes = new ArrayList<>();
          for (Type type : types) {
  
              if (!ParameterizedType.class.isAssignableFrom(type.getClass())) {
                  // the field is it a raw type and does not have generic type
                  // argument. Return empty list.
                  return new ArrayList<Class<?>>();
              }
  
              ParameterizedType ptype = (ParameterizedType) type;
              Type[] targs = ptype.getActualTypeArguments();
  
              for (Type aType : targs) {
  
                  classes.add(extractClass(ownerClass, aType));
              }
          }
          return classes;
      }
docs: Returns the parameterized type of a class, if exists. Wild cards, type
  variables and raw types will be returned as an empty list.
  <p>
  If a field is of type Set<String> then java.lang.String is returned.
  </p>
  <p>
  If a field is of type Map<String, Integer> then [java.lang.String,
  java.lang.Integer] is returned.
  </p>
  
  @param ownerClass the implementing target class to check against
  @param ownerClass generic interface to resolve the type argument from
  @return A list of classes of the parameterized type.