code: @SuppressWarnings("rawtypes")
      public static final SerIterator collection(
              final Collection<?> coll, final Class<?> declaredType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
          return new SerIterator() {
              private final Iterator it = coll.iterator();
              private Object current;
  
              @Override
              public String metaTypeName() {
                  if (coll instanceof Set) {
                      return "Set";
                  }
                  if (coll instanceof List) {
                      return "List";
                  }
                  return "Collection";
              }
              @Override
              public boolean metaTypeRequired() {
                  if (coll instanceof Set) {
                      return Set.class.isAssignableFrom(declaredType) == false;
                  }
                  if (coll instanceof List) {
                      return List.class.isAssignableFrom(declaredType) == false;
                  }
                  return Collection.class.isAssignableFrom(declaredType) == false;
              }
              @Override
              public int size() {
                  return coll.size();
              }
              @Override
              public boolean hasNext() {
                  return it.hasNext();
              }
              @Override
              public void next() {
                  current = it.next();
              }
              @Override
              public Class<?> valueType() {
                  return valueType;
              }
              @Override
              public List<Class<?>> valueTypeTypes() {
                  return valueTypeTypes;
              }
              @Override
              public Object value() {
                  return current;
              }
          };
      }
docs: Gets an iterator wrapper for {@code Collection}.
  
  @param coll  the collection, not null
  @param declaredType  the declared type, not null
  @param valueType  the value type, not null
  @param valueTypeTypes  the generic parameters of the value type
  @return the iterator, not null