public void addStatisticField(final StatisticField statisticField) {
        if (fields == null) {
            fields = new ArrayList<>();
        }
        // prevent duplicates
        if (!fields.contains(statisticField)) {
            fields.add(statisticField);
            sortFieldListAndCachePositions();
        }
    }
Cache the positions of the fields.
stroom-core-shared/src/main/java/stroom/statistics/impl/hbase/shared/StroomStatsStoreEntityData.java