private static void getPositiveTerms(Item item, List<IndexedItem> terms) {
        if (item instanceof NotItem notItem) {
            getPositiveTerms(notItem.getPositiveItem(), terms);
        } else if (item instanceof PhraseItem phraseItem) {
            terms.add(phraseItem);
        } else if (item instanceof CompositeItem compositeItem) {
            for (Iterator<Item> i = compositeItem.getItemIterator(); i.hasNext();) {
                getPositiveTerms(i.next(), terms);
            }
        } else if (item instanceof TermItem termItem) {
            terms.add(termItem);
        }
    }
Returns a flattened list of all positive query terms under the given item
container-search/src/main/java/com/yahoo/search/query/QueryTree.java