public static int getCurrentToken() throws TikaException {
        long currentToken = token.incrementAndGet();

        // The token value cannot be exceed the value 4294967295.
        if (currentToken > MAXTOKENVALUE) {
            throw new TikaException("The token exceeds the max value 4294967295");
        }

        return (int) currentToken;
    }
This method is used to get the current token value and atomic adding the token by 1.

@return Returns the current token value.
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