<p>In the Java collections framework, the Collection interface declares the following method:</p>
<blockquote>
<p><a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#toArray(T%5B%5D)" rel="noreferrer"><code>&lt;T&gt; T[] toArray(T[] a)</code></a></p>
<p>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.</p>
</blockquote>
<p>If you wanted to implement this method, how would you create an array of the type of <strong>a</strong>, known only at runtime?</p>

```
```
Array.newInstance(Class componentType, int length)
```
```