public void addItem(int index, Item item) {
        if (index > subitems.size() || index < 0)
            throw new IndexOutOfBoundsException("Could not add a subitem at position " + index + " to " + this);
        adding(item);
        subitems.add(index, item);
    }
Inserts the item at a position and increases the index of existing items
starting on this position by one

@throws IndexOutOfBoundsException if the index is out of range
container-search/src/main/java/com/yahoo/prelude/query/CompositeItem.java