title: Differences between concurrent and synchronized collections in Java?
body: <p>In Java there are</p>
  <ol>
  <li><p>concurrent collections (e.g. <code>java.util.concurrent.CopyOnWriteArrayList</code>)</p>
  </li>
  <li><p>synchronized collections (e.g. <code>Collections.synchronizedList(List&lt;T&gt; list)</code>)</p>
  </li>
  </ol>
  <p>My insights so far:</p>
  <ul>
  <li>both types are thread safe regarding invoking their operations (<code>add()</code>, <code>get()</code> and so on)</li>
  <li>BUT: If you iterate over a Collection from type 2) it isn't thread safe at all (compare <a href="https://stackoverflow.com/a/49490033/2438518">this answer</a>).Whereas iterating over a Collection of type 1) is thread safe.</li>
  </ul>
  <p>Are there any other differences? And why has Java both types of collections? Wouldn't it be clearer to only have one type?</p>