public class Test{
private static ThreadLocal<String> testName =
new ThreadLocal<String>();
}
If we one have one instance of the class Thread and this is access from different Threads, every Thread will have a testName value.But How do we assing values? Easy, just do:
testName.set("FirstTest");
And now to get the value we use:String name = testName.get();