You can use a ThreadLocal variable when you have some object that is not thread-safe, but you want to avoid synchronizing access to that object. So, in that case, you can give each thread its own instance of the object.
For example:
public class Demo
{
private static final ThreadLocal<SimpleDateFormat> formatter = new ThreadLocal<SimpleDateFormat>(){
@Override
protected SimpleDateFormat initialValue()
{
return new SimpleDateFormat("yyyyMMdd HHmm");
}
};
public String formatIt(Date date)
{
return formatter.get().format(date);
}
}