Java tutorial
//package com.java2s; import java.util.HashMap; import java.util.Map; public class Main { static Map THREAD_LOCAL_MAP = new HashMap(); public static String getDebugInfo() { Object v = get("DEBUG"); return v == null ? null : v.toString(); } public static Object get(String key) { ThreadLocal tl = (ThreadLocal) THREAD_LOCAL_MAP.get(key); if (tl == null) return null; return tl.get(); } }