Here you can find the source of getUniqueId()
public static int getUniqueId()
//package com.java2s; //License from project: Open Source License import java.util.concurrent.atomic.AtomicInteger; public class Main { private static final AtomicInteger ID_GENERATOR = new AtomicInteger(); public static int getUniqueId() { return ID_GENERATOR.getAndIncrement(); }// ww w . ja v a 2s. com }