public String incrementLevel(int levelNumber, LevelTuple[] overrideLevelTuples) {

            for (int i = lastLevel + 1; i < levelNumber; i++) {
                if (i >= counts.size()) {
                    int val = getStart(i, overrideLevelTuples);
                    counts.add(i, val);
                } else {
                    int count = counts.get(i);
                    if (count == NOT_SEEN_YET) {
                        count = getStart(i, overrideLevelTuples);
                        counts.set(i, count);
                    }
                }
            }

            if (levelNumber < counts.size()) {
                resetAfter(levelNumber, overrideLevelTuples);
                int count = counts.get(levelNumber);
                if (count == NOT_SEEN_YET) {
                    count = getStart(levelNumber, overrideLevelTuples);
                } else {
                    count++;
                }
                counts.set(levelNumber, count);
                lastLevel = levelNumber;
                return format(levelNumber, overrideLevelTuples);
            }

            counts.add(levelNumber, getStart(levelNumber, overrideLevelTuples));
            lastLevel = levelNumber;
            return format(levelNumber, overrideLevelTuples);
        }
Apply this to every numbered paragraph in order.

@param levelNumber level number that is being incremented
@return the new formatted number string for this level
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/AbstractListManager.java