@Test
    void testRemove() {
        HitGroup hits = new HitGroup();
        hits.add(new Hit("foo"));
        hits.add(new Hit("bar"));

        Iterator<Hit> it = hits.deepIterator();
        try {
            it.remove();
            fail();
        } catch (IllegalStateException e) {
            // need to call next() first
        }
        assertTrue(it.hasNext());
        assertEquals("foo", it.next().getId().toString());
        assertTrue(it.hasNext());
        try {
            it.remove();
            fail();
        } catch (IllegalStateException e) {
            // prefetch done
        }
        assertEquals("bar", it.next().getId().toString());
        it.remove(); // no prefetch done
        assertFalse(it.hasNext());
    }
Ensure that the {@link DeepHitIterator} works as intended.

@author havardpe
container-search/src/test/java/com/yahoo/search/result/test/DeepHitIteratorTestCase.java