public UniqueId generateId() {
        final State state = stateRef.accumulateAndGet(State.ofNow(), (currState, newState) -> {
            return newState.epochMs > currState.epochMs
                    ? newState
                    : currState.withNextSequenceNo();
        });
        return new UniqueId(state.epochMs, state.sequenceNo, nodeType, nodeId);
    }
Each call will generate a new globally unique ID.
stroom-util/src/main/java/stroom/util/concurrent/UniqueIdGenerator.java