code: public Class<?> getArrayOrCollectionComponentType() {
          if (!isCollection() && !isArray()) {
              throw new IllegalStateException();
          }
  
          if (isCollection()) {
              Type type = field.getGenericType();
              if (type instanceof ParameterizedType) {
                  return toClass(((ParameterizedType) type).getActualTypeArguments()[0]);
              } else {
                  String message = String.format("Cannot determine the type parameter of the collection-typed field %s. Raw types are not supported", field);
                  throw new IllegalArgumentException(message);
              }
          } else {
              return field.getType().getComponentType();
          }
      }
docs: For collection- and array-typed properties (i.e., only applies when
  {@link #isCollection()} or {@link #isArray()} is {@code true}.