public void testIterator() throws InterruptedException {
  LinkedBlockingQueue q=populatedQueue(SIZE);
  Iterator it=q.iterator();
  while (it.hasNext()) {
    assertEquals(it.next(),q.take());
  }
}

public void testIterator ( ) throws InterruptedException { LinkedBlockingQueue q = populatedQueue ( SIZE ) ; Iterator it = q . iterator ( ) ; while ( it . hasNext ( ) ) { assertEquals ( it . next ( ) , q . take ( ) ) ; } }
iterator iterates through all elements
