Here you can find the source of generate()
public static String generate()
//package com.java2s; //License from project: LGPL import java.util.UUID; public class Main { public static String generate() { return generate(false); }//from w w w. j a va 2 s. c o m public static String generate(boolean withSeparator) { String uuid = UUID.randomUUID().toString(); if (!withSeparator) { uuid = uuid.replace("-", ""); } return uuid; } }