private void traverse(CompositeItem base, IndexFacts.Session indexFacts) {
        for (Iterator<Item> i = base.getItemIterator(); i.hasNext();) {
            Item next = i.next();
            if (next instanceof WordItem) {
                lowerCase((WordItem) next, indexFacts);
            } else if (next instanceof SameElementItem) {
                traverseSameElement((SameElementItem) next, indexFacts);
            } else if (next instanceof CompositeItem) {
                traverse((CompositeItem) next, indexFacts);
            } else if (next instanceof WeightedSetItem) {
                if (transformWeightedSets) {
                    lowerCase((WeightedSetItem) next, indexFacts);
                }
            } else if (next instanceof WordAlternativesItem) {
                lowerCase((WordAlternativesItem) next, indexFacts);
            } else if (next instanceof StringInItem) {
                lowerCase((StringInItem) next, indexFacts);
            }
        }
    }
Traverse a query tree and lowercase terms based on decision made in subclasses.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/search/querytransform/LowercasingSearcher.java