Why Java HashMap Uses (n - 1) & hash Instead of % n

If you’ve ever dug into HashMap internals, one line probably stood out: