code: public Object[] toArray() {
          Object[] result = new Object[size];
          int i = 0;
          for (Node<E> x = first; x != null; x = x.next)
              result[i++] = x.item;
          return result;
      }
docs: Returns an array containing all of the elements in this list
  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 list.  (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.
  
  @return an array containing all of the elements in this list
  in proper sequence