Basics of Collections.synchronizedMap in java
<p>I have a class with huge static data structure. and many threads might be read-accessing it in parallel. I am suggested to use Collections.synchronizedMap</p>

<p>private static Map &lt; String, HashSet &lt; String >> HashSets =
    Collections.synchronizedMap (new HashMap &lt; String,
                                 HashSet &lt; String >> ());</p>

<p>As per <a href="http://download.oracle.com/javase/6/docs/api/" rel="nofollow">http://download.oracle.com/javase/6/docs/api/</a> , I need to use synchronized() keyword while accessing values.I don't understand it quite well.</p>

<p>How should I modify below accesses:</p>

<pre><code>if (HashSets.get (lang).contains (st))

if (HashSets.containsKey (lang) == false)

HashSets.put (lang, testhashset);
</code></pre>

<p>Any links explaining in detail should be useful.</p>

<p>Thanks,</p>
