title: How does ConcurrentHashMap work internally?
body: <p>I was reading the official Oracle documentation about Concurrency in Java and I was wondering what could be the difference between a <code>Collection</code> returned by</p>
  
  <pre><code>public static &lt;T&gt; Collection&lt;T&gt; synchronizedCollection(Collection&lt;T&gt; c);
  </code></pre>
  
  <p>and using for example a </p>
  
  <p><code>ConcurrentHashMap</code>. I'm assuming that I use <code>synchronizedCollection(Collection&lt;T&gt; c)</code> on a <code>HashMap</code>. I know that in general a synchronized collection is essentially just a decorator for my <code>HashMap</code> so it is obvious that a <code>ConcurrentHashMap</code> has something different in its internals. Do you have some information about those implementation details?</p>
  
  <p><strong>Edit: I realized that the source code is publicly available:</strong>
  <a href="http://www.docjar.com/html/api/java/util/concurrent/ConcurrentHashMap.java.html">ConcurrentHashMap.java</a></p>