public <T> T[] toArray(T[] a)
public Object[] toArray()
  public <T> T[] toArray(T[] a)  {    int size = size();    if (a.length < size)      a = (T[]) Array.newInstance(a.getClass().getComponentType(),                                       size);    else if (a.length > size)      a[size] = null;    Iterator<E> itr = iterator();    for (int pos = 0; pos < size; pos++)      {	try	  {	    a[pos] = (T) (itr.next());	  }	catch (ClassCastException exception)	  {	    throw new ArrayStoreException("The element is of the wrong type "+					  "for storing in this array.");	  }      }    return a;  }