In the Java collections framework, the Collection interface declares the following method:
T[] toArray(T[] a)
"Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection 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 this collection."
If you wanted to implement this method, how would you create an array of the type of a, known only at runtime?