Here you can find the source of generateId()
public static String generateId()
//package com.java2s; //License from project: Apache License import java.util.concurrent.atomic.AtomicLong; public class Main { private static AtomicLong counter = new AtomicLong(1); public static String generateId() { return counter.getAndIncrement() + "-" + System.currentTimeMillis(); }// w w w.j a v a2 s . c o m }