• Hash Map classes in java handle collision by chaining, They Use a linked list to store map entries that ended in the same bucket due to a collision, if a key end up in the same bucket location where an entry is already stored then this entry is just added at the head of linked list because of that its impact the performance of get() method of Hash Map, So in this case Java 8 has started to use the balanced tree to store the collided entries.
  • First HashMap will start to use the link list when the no of entries is more than the threshold (size is 8) it will replace the link list with a balanced tree.
  • Feature of converting the link list into balance tree( for collision case only ) are available into only Concurrent HashMap, LinkedHashMap, and HashMap
  • A collision will occur when 2 different keys have the same hashCode, which can happen because two unequal objects in java can have the same hashCode.