public void set(int index, Hit hit) {
        updateHits();
        if (hit instanceof ErrorHit) { // Merge instead
            add(hit);
            return;
        }

        handleNewHit(hit);
        Hit oldHit = hits.set(index, hit);

        if (oldHit!=null)
            handleRemovedHit(oldHit);
    }
Inserts the given hit at the specified index in this group.
container-search/src/main/java/com/yahoo/search/result/HitGroup.java