title: Are size(), put(), remove(), get() atomic in Java synchronized HashMap?
body: <p>I am declaring a Java Map as </p>
  
  <pre><code>Map&lt;String, String&gt; map = Collections.synchronizedMap(new HashMap&lt;String, String&gt;());
  </code></pre>
  
  <p>to deal with the concurrency issues, and synchronizing on the map for all the operations on it.  However, I read that synchronization isn't necessary on a <code>synchronizedMap</code> when the operations are atomic.  I checked the Java API and the documentation of HashMap doesn't seem to mention which are atomic, so I'm not sure which are.</p>
  
  <p>I'm synchronizing on the following calls to the map:</p>
  
  <pre><code>map.size()
  
  map.put()
  
  map.remove()
  
  map.get()
  </code></pre>
  
  <p>But if some are atomic, it seems synchronization isn't necessary for these.  Which are atomic?</p>