MaterializedDeduplicatedResultSet extends WrappedResultSet<O> { @Override public Iterator<O> iterator() { return IteratorUtil.materializedDeuplicate(super.iterator()); } MaterializedDeduplicatedResultSet(ResultSet<O> wrappedResultSet); @Override Iterator<O> iterator(); @Override int size(); @Override boolean isEmpty(); @Override boolean isNotEmpty();  }
@Test public void testMaterializingResultSetIterator() throws Exception { final MaterializedDeduplicatedResultSet<Object> set = new MaterializedDeduplicatedResultSet<Object>(new StoredSetBasedResultSet<Object>(Collections.<Object>singleton(this))); final Iterator<Object> it = set.iterator(); Assert.assertTrue(it.hasNext()); Assert.assertTrue(it.hasNext()); }