question: @ SuppressWarnings ( "unchecked" ) public Object [ ] toArray ( ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] a = new Object [ count ] ; int k = 0 ; for ( Node < E > p = first ; p != null ; p = p . next ) a [ k ++ ] = p . item ; return a ; } finally { lock . unlock ( ) ; } }
target:  Returns an array containing all of the elements in this deque, in proper sequence (from first to last element). <p>The returned array will be "safe" in that no references to it are maintained by this deque.  (In other words, this method must allocate a new array).  The caller is thus free to modify the returned array. <p>This method acts as bridge between array-based and collection-based APIs.