private static CanonicalizationResult canonicalizeThis(Item item, ListIterator<Item> parentIterator) {
        if (item instanceof NullItem) parentIterator.remove();
        if ( ! (item instanceof CompositeItem composite)) return CanonicalizationResult.success();

        boolean replacedByFalse = collapseFalse(composite, parentIterator);
        if (replacedByFalse) return CanonicalizationResult.success();

        collapseLevels(composite);

        if (composite instanceof EquivItem) {
            removeDuplicates((EquivItem) composite);
        }
        if (composite.getItemCount() == 0)
            parentIterator.remove();

        composite.extractSingleChild().ifPresent(parentIterator::set);

        return CanonicalizationResult.success();
    }
Canonicalize this query

@param item the item to canonicalize
@param parentIterator iterator for the parent of this item, never null
@return result of canonicalization
container-search/src/main/java/com/yahoo/prelude/query/QueryCanonicalizer.java