public void resetToLast() {
        if (flattenedItems != null)
            previousQuerySize = flattenedItems.size();
        traceIndentation = "";
        flattenedItems = new java.util.ArrayList<>();
        flatten(query.getModel().getQueryTree().getRoot(), 0, flattenedItems);
        currentIndex = flattenedItems.size() - 1;
    }
Resets the item iterator to point to the last item:
container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java