question: private < T > T [ ] copyElements ( T [ ] a ) { if ( head < tail ) { System . arraycopy ( elements , head , a , 0 , size ( ) ) ; } else if ( head > tail ) { int headPortionLen = elements . length - head ; System . arraycopy ( elements , head , a , 0 , headPortionLen ) ; System . arraycopy ( elements , 0 , a , headPortionLen , tail ) ; } return a ; }
target:  Copies the elements from our element array into the specified array, in order (from first to last element in the deque).  It is assumed that the array is large enough to hold all elements in the deque.