public boolean hasNext() {
        if (hits.size() > (index + 1)) {
            return true;
        } else {
            return false;
        }
    }
Whether the iterator is in a state where remove is OK
container-search/src/main/java/com/yahoo/search/result/HitIterator.java