@Test public void whenNextInEmptyListThenResultException() { Iterator itr = list.iterator(); try { itr.next(); } catch (NoSuchElementException nsee) { assertThat(nsee.getMessage(), is("No more elements in list")); } }
@Override public Iterator iterator() { return new Itr(); }
MyLinkedList implements SimpleContainer<E> { @Override public Iterator iterator() { return new Itr(); } }
MyLinkedList implements SimpleContainer<E> { @Override public Iterator iterator() { return new Itr(); }  }
MyLinkedList implements SimpleContainer<E> { @Override public Iterator iterator() { return new Itr(); }  @Override E get(int index); @Override void add(E e); int size(); void remove(int index); void checkRange(int index); @Override Iterator iterator(); }
MyLinkedList implements SimpleContainer<E> { @Override public Iterator iterator() { return new Itr(); }  @Override E get(int index); @Override void add(E e); int size(); void remove(int index); void checkRange(int index); @Override Iterator iterator();  }