HashMap in java 8 is different from the older version on the Entry. In java 8 version, when there are many nodes in one hash unit(default is more than 8), the Entry is convert to TreeNode type, and then use tree to add, delete and find. When the nodes become less(default is 6), the entry will then convert from TreeNode to normal Entry.