Here you can find the source of generateUuidStringStatic()
public static synchronized String generateUuidStringStatic()
//package com.java2s; /*/*from w ww.j a v a 2s . c om*/ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. // You must accept the terms of that agreement to use this software. // // Copyright (C) 2007-2012 Pentaho // All Rights Reserved. */ import java.util.*; public class Main { private static String previousUuid = ""; private static final String UUID_BASE = Long.toHexString(new Random() .nextLong()); public static synchronized String generateUuidStringStatic() { while (true) { String uuid = UUID_BASE + Long.toHexString(System.currentTimeMillis()); if (!uuid.equals(previousUuid)) { previousUuid = uuid; return uuid; } try { Thread.sleep(1); } catch (InterruptedException e) { throw new RuntimeException(e); } } } }