synchronized void add(final Key groupKey, final StoredValues storedValues) {
            if (groupingFunction != null || sortingFunction != null) {
                list.add(new ItemImpl(dataStore, groupKey, storedValues));
                trimmed = false;
                if (list.size() > maxSize) {
                    sortAndTrim();
                }
            } else if (list.size() < trimmedSize) {
                list.add(new ItemImpl(dataStore, groupKey, storedValues));
            } else {
                logTruncation();
                removeHandler.accept(groupKey);
            }
        }
Set to false if we don't want to keep looking through the store.
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/MapDataStore.java