code: @Override
    public Iterator<T> iterator() {
      return new Iterator<T>() {
  
        /** The index of the next item. */
        private int next = ArrayQueue.this.next;
  
        /* (non-Javadoc)
         * @see java.util.Iterator#hasNext()
         */
        public boolean hasNext() {
          return next < items.length;
        }
  
        /* (non-Javadoc)
         * @see java.util.Iterator#next()
         */
        public T next() {
          if (next >= items.length) {
            throw new NoSuchElementException();
          }
          return items[next++];
        }
  
        /* (non-Javadoc)
         * @see java.util.Iterator#remove()
         */
        public void remove() {
          throw new UnsupportedOperationException();
        }
  
      };
    }
docs: /* (non-Javadoc)
  @see java.util.AbstractCollection#iterator()