Here you can find the source of generateId()
public static String generateId()
//package com.java2s; /******************************************************************************* * Copyright (c) 2011-2012 Nokia Corporation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://w w w.j a va 2s . c o m * Comarch team - initial API and implementation *******************************************************************************/ import java.util.Random; public class Main { private static Random rng = new Random(); public static String generateId() { int id = 1000000 + rng.nextInt(8999999); String sid = String.valueOf(id); return ("id" + sid); } }