@Test public void testInsert() { Queue<Integer> q = new Queue<Integer>(); q.insert(1); q.insert(2); assertFalse(q.isEmpty()); }
@Test public void testIsEmpty() { Queue<Integer> q = new Queue<Integer>(); q.insert(1); assertFalse(q.isEmpty()); q.remove(); assertTrue(q.isEmpty()); }
@Test public void testIterator() { Queue<Integer> q = new Queue<Integer>(); q.insert(1); q.insert(2); Iterator<Integer> x = q.iterator(); assertTrue(x.hasNext()); x.next(); assertTrue(x.hasNext()); x.next(); assertFalse(x.hasNext()); }