code: public Object[] toArray(Object array[]) {
  	if (array.length < size)
  		array = (Object[])java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), size);
  
  	Object[] theElements = elements;
  	for (int i=size; --i >=0; ) array[i]=theElements[i];
  
  	if (array.length > size) array[size] = null;
  
  	return array;
  }
docs: Returns an array containing all of the elements in the receiver in the
  correct order.  The runtime type of the returned array is that of the
  specified array.  If the receiver fits in the specified array, it is
  returned therein.  Otherwise, a new array is allocated with the runtime
  type of the specified array and the size of the receiver.
  <p>
  If the receiver fits in the specified array with room to spare
  (i.e., the array has more elements than the receiver),
  the element in the array immediately following the end of the
  receiver is set to null.  This is useful in determining the length
  of the receiver <em>only</em> if the caller knows that the receiver
  does not contain any null elements.
  
  @param array the array into which the elements of the receiver are to
  be stored, if it is big enough; otherwise, a new array of the
  same runtime type is allocated for this purpose.
  @return an array containing the elements of the receiver.
  @exception ArrayStoreException the runtime type of <tt>array</tt> is not a supertype
  of the runtime type of every element in the receiver.