private void fixConnexity(CompositeItem copy) {
        int hasUniqueIdCount = countUniqueId(this);
        if (hasUniqueIdCount == 0) return;
        List<Item> flat = new ArrayList<>(hasUniqueIdCount);
        List<Item> flatCopy = new ArrayList<>(hasUniqueIdCount);
        taggingFlatten(this, flat);
        taggingFlatten(copy, flatCopy);
        int barrier = flat.size();
        for (int i = 0; i < barrier; ++i) {
            Item orig = flat.get(i);
            int connectedTo = find(orig.connectedItem, flat);
            if (connectedTo >= 0) {
                TaggableItem tagged = (TaggableItem) flatCopy.get(i);
                tagged.setConnectivity(flatCopy.get(connectedTo), orig.connectivity);
            }
        }
    }
Returns a deep copy of this item
container-search/src/main/java/com/yahoo/prelude/query/CompositeItem.java