code: public static byte[] randomUUID() {
          SecureRandom ng = numberGenerator;
          if (ng == null) {
              numberGenerator = ng = new SecureRandom();
          }
          byte[] randomBytes = new byte[16];
          ng.nextBytes(randomBytes);
          randomBytes[6] &= 0x0f;  /* clear version        */
          randomBytes[6] |= 0x40;  /* set to version 4     */
          randomBytes[8] &= 0x3f;  /* clear variant        */
          randomBytes[8] |= 0x80;  /* set to IETF variant  */
          return randomBytes;
      }
docs: Static factory to retrieve a type 4 (pseudo randomly generated) UUID.
  
  The <code>UUID</code> is generated using a cryptographically strong
  pseudo random number generator.
  
  Source code was got from sources of java
  @return  a randomly generated <tt>UUID</tt>.