x.hashcode() & 0xfffffff will disable the sign. Math.abs is not used here because it returns negative if x.hashCode is Integer.MIN_VALUE , which will make the hashtable's array ArrayOutOfBoundException , which is not funny.
From @JonSkeet's comment: it does not just turn off the sign, it also clears the next three bits.
But with hash codes, we deal with collisions all the time, so it's considered great.
source share