Java tutorial
//package com.java2s; //License from project: Open Source License import static com.google.common.base.Preconditions.checkState; public class Main { /** * Throws an {@link IllegalStateException} if the current thread is not an initialization thread. */ public static void ensureInitThread() { Thread currentThread = Thread.currentThread(); boolean isInitThread = currentThread.getName().equals("LunaInitializationThread"); checkState(isInitThread, String.format("thread[%s] not an initialization thread", currentThread)); } }