public void testFirstIteratorIsEmptyBug() { List empty = new ArrayList(); List notEmpty = new ArrayList(); notEmpty.add("A"); notEmpty.add("B"); notEmpty.add("C"); IteratorChain chain = new IteratorChain(); chain.addIterator(empty.iterator()); chain.addIterator(notEmpty.iterator()); assertTrue("should have next",chain.hasNext()); assertEquals("A",chain.next()); assertTrue("should have next",chain.hasNext()); assertEquals("B",chain.next()); assertTrue("should have next",chain.hasNext()); assertEquals("C",chain.next()); assertTrue("should not have next",!chain.hasNext()); }
public void testEmptyChain() { IteratorChain chain = new IteratorChain(); assertEquals(false, chain.hasNext()); try { chain.next(); fail(); } catch (NoSuchElementException ex) {} try { chain.remove(); fail(); } catch (IllegalStateException ex) {} }
public Object next() { return _itr.next(); }
public Object next() { return _itr.next(); }
public Object next() { return _itr.next(); }
public Object next() { return _itr.next(); }
public Object next() { return _itr.next(); }
public Object next() { if (_closed) throw new NoSuchElementException(); return super.next(); }
public Object next() { if (_state != OPEN) throw new NoSuchElementException(); _last = _itr.next(); return _last; }
public Object next() { if (_state != OPEN) throw new NoSuchElementException(); _last = _itr.next(); return _last; }
public Object next() { if (_state != OPEN) throw new NoSuchElementException(); _last = _itr.next(); return _last; }
public Object next() { if (_state != OPEN) throw new NoSuchElementException(); _last = _itr.next(); return _last; }
public Object next() { if (_closed) throw new NoSuchElementException(); return super.next(); }
public Object next() { if (_closed) throw new NoSuchElementException(); return super.next(); }
public Object next() { if (_closed) throw new NoSuchElementException(); return super.next(); }
public Object next() { if (_closed) throw new NoSuchElementException(); return super.next(); }
public Object next() { if (_state != OPEN) throw new NoSuchElementException(); _last = _itr.next(); return _last; }
public Object next() { if (_state != OPEN) throw new NoSuchElementException(); _last = (Map.Entry) _itr.next(); switch (_mode) { case MODE_KEY: return _last.getKey(); case MODE_VALUE: return _last.getValue(); default: return _last; } }
ItemState state = (ItemState) chain.next(); if (containedInTree(target, state)) { affectedStates.add(state);
ItemState state = (ItemState) chain.next(); if (containedInTree(target, state)) { affectedStates.add(state);