public static int GetCurrentSerialNumber() {
        // Thread safety increase the token by 1.
        long currentID = serialNumber.incrementAndGet();
        return (int) currentID;
    }
This method is used to get the current serial number and atomic adding the token by 1.

@return Return the current serial number.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/fsshttpb/util/SequenceNumberGenerator.java