title: Is HashMap in Java collision safe
body: <p>I am developing a parser that needs to put key value pairs in hashmap.</p>
  
  <p>But a key can have multiple values which i can do in this way</p>
  
  <p><code>HashMap&lt;String,ArrayList&lt;String&gt;&gt;</code> .</p>
  
  <p>But what happens if number of keys are very large and it start matching with other key's hashcode.</p>
  
  <p>Will that rewrite previous key's value ?</p>