title: How to initialise a thread-local with type Map using ThreadLocal.withInitial?
body: <p>I'm trying to initialise a thread-local of type Map using "ThreadLocal.withInital" method</p>
  
  <p>I can proceed with setting a new ThreadLocal and adding a setter method to proceed with the initialisation. But I'm trying to find a way whether this can be done via initial.</p>
  
  <pre><code>private static final ThreadLocal&lt;Map&lt;Date, Boolean&gt;&gt; dateBooleantl = new ThreadLocal&lt;&gt;();
  </code></pre>
  
  <p>Expected Output: </p>
  
  <pre><code>private static final ThreadLocal&lt;Map&lt;Date, Boolean&gt;&gt; dateBooleantl = ThreadLocal.withInitial(&lt;Hash-map that is set with a predefined date and a boolean&gt;)
  </code></pre>