question: @ Override @ SuppressWarnings ( "unchecked" ) public synchronized < T > T [ ] toArray ( T [ ] contents ) { if ( elementCount > contents . length ) { throw new RuntimeException ( "Collection.toArray(T[]) requires an array of the same size as the collection to be passed as a parameter. " ) ; } System . arraycopy ( elementData , 0 , contents , 0 , elementCount ) ; if ( elementCount < contents . length ) { contents [ elementCount ] = null ; } return contents ; }
target:  Returns an array containing all elements contained in this vector. If the specified array is large enough to hold the elements, the specified array is used, otherwise an array of the same type is created. If the specified array is used and is larger than this vector, the array element following the collection elements is set to null.