public static int getCurrentFSSHTTPBSubRequestID() throws TikaException {
        // Thread safety increase the token by 1.
        long currentID = subRequestID.incrementAndGet();

        // The token value cannot be exceed the value 0xFFFFFFFF.
        if (currentID > MAXSUBREQUESTID) {
            throw new TikaException("The token exceeds the max value 4294967295");
        }

        return (int) currentID;
    }
This method is used to get the current sub request ID and atomic adding the token by 1.

@return Returns the current sub request ID.
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