public static void main(String[] args) {
		ExecutorService es = Executors.newCachedThreadPool();

		final IDLockManager lm = new IDLockManager();

		final String[] ids = new String[] { "a", "b", "c" };
		for (int i = 0; i < 20; i++) {
			final int x = i;
			Runnable task = new Runnable() {
				public void run() {
					int count = 0;
					while (true) {
						count++;
						try {
							String id = ids[r.nextInt(ids.length)];
							lm.lockID(id);
							try {
								Thread.sleep(r.nextInt(300));
							} finally {
								lm.unlockID(id);
								debug("******************* " + x + "/" + count, id);
							}
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}
			};
			es.submit(task);
		}

	}