Java’s HashMap (AbstractMap really) hashCode() implementation sums the hash codes of its entries rather than multiplies them by a prime number like String.hashCode() does. This can cause weird collisions in very similar maps.
Oct 17 2018
Java’s HashMap (AbstractMap really) hashCode() implementation sums the hash codes of its entries rather than multiplies them by a prime number like String.hashCode() does. This can cause weird collisions in very similar maps.