private static UUID generateRandomUuid() {
        final Random rnd = ThreadLocalRandom.current();
        long mostSig  = rnd.nextLong();
        long leastSig = rnd.nextLong();

        // Identify this as a version 4 UUID, that is one based on a random value.
        mostSig &= 0xffffffffffff0fffL;
        mostSig |= 0x0000000000004000L;

        // Set the variant identifier as specified for version 4 UUID values.  The two
        // high order bits of the lower word are required to be one and zero, respectively.
        leastSig &= 0x3fffffffffffffffL;
        leastSig |= 0x8000000000000000L;

        return new UUID(mostSig, leastSig);
    }
private static UUID generateRandomUuid ( ) { final Random rnd = ThreadLocalRandom . current ( ) ; long mostSig = rnd . nextLong ( ) ; long leastSig = rnd . nextLong ( ) ; mostSig &= 0xffffffffffff0fffL ; mostSig |= 0x0000000000004000L ; leastSig &= 0x3fffffffffffffffL ; leastSig |= 0x8000000000000000L ; return new UUID ( mostSig , leastSig ) ; }
Generate a random UUID v4 that will perform reasonably when used by
multiple threads under load.

@see <a href="https://github.com/Netflix/netflix-commons/blob/v0.3.0/netflix-commons-util/src/main/java/com/netflix/util/concurrent/ConcurrentUUIDFactory.java">ConcurrentUUIDFactory</a>
@return random UUID