code: @SuppressWarnings("unchecked")
      public <E> E[] toArray(E[] array) {
  	for (int i = 0; i < array.length; ++i) {
              Integer j = indexToValue.get(i);
              if (j != null)
                  array[i] = (E)j;
  	}
  	return array;
      }
docs: {@inheritDoc}