private void insertMutableInTree(CompositeItem mutable, CompositeItem original, CompositeItem parent) {
        if (parent == null) {
            query.getModel().getQueryTree().setRoot(mutable);

        } else {
            int parentsIndex = parent.getItemIndex(original);
            parent.setItem(parentsIndex, mutable);
        }
    }
Convert segment items into their mutable counterpart, do not update query tree.
Non-segment items are returned directly.

@return a mutable CompositeItem instance
container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java