ChunkFilteredIterator implements Iterator<String> { @Override public void remove() { throw new UnsupportedOperationException("remove() not supported!"); } ChunkFilteredIterator(Iterator<String> iterator); @Override boolean hasNext(); @Override String next(); @Override void remove();  }
@Test public void testRemove() throws Exception { iterator = new ChunkFilteredIterator(space.iterator()); try { iterator.remove(); Assert.fail("exception expected."); } catch (UnsupportedOperationException e) { } }