Due to the filter mechanism, the remove() method will throw an
IllegalStateException if hasNext() has been called after next().
The reason is that IteratorFilter.hasNext() must call next() on the base
iterator to determine if there are element matching the filter after the
current one. For example, the following code is INVALID
Iterator i = new IteratorFilter(baseIterator);
i.remove(); // <== IllegalStateException because hasNext() has moved the
// current pointer on the baseIterator.