code: @Override
    /*!#if ($TemplateOptions.KTypePrimitive)
    public KType [] toArray()
       #else !*/
    public Object[] toArray()
    /*! #end !*/
    {
      KType[] array = Intrinsics.<KType> newArray(size());
      int i = 0;
      for (KTypeCursor<KType> c : this) {
        array[i++] = c.value;
      }
      return array;
    }
docs: Default implementation of copying to an array.