### Question:
MemoizableIterator implements Iterator<T> { public T current() { if(!currentInitialized) throw new IllegalStateException("Invoke next() at least once"); return current; } MemoizableIterator(Iterator<T> delegate); static MemoizableIterator<T> wrap(Iterator<T> iterator); @Override boolean hasNext(); @Override T next(); @Override void remove(); T current();  }### Answer:
@Test(expected = IllegalStateException.class) public void current_should_throw__when_no_more_elements () { List<String> elements = Arrays.asList(); MemoizableIterator<String> it = new MemoizableIterator<String>(elements.iterator()); it.current(); }