code: public <T> T [] toArray(Class<T> componentClass) {
      final int size = size();
      final T[] array = (T[]) java.lang.reflect.Array.newInstance(componentClass, size);
      int i = 0;
      for (KTypeCursor<KType> c : this) {
        array[i++] = (T) c.value;
      }
      return array;
    }
docs: /*!#if ($TemplateOptions.KTypeGeneric) !