title: Why is the maximum capacity of a Java HashMap 1<<30 and not 1<<31?
body: <p>Why is the maximum capacity of a Java HashMap 1&lt;&lt;30 and not 1&lt;&lt;31, even though the max value of an int is 2<sup>31</sup>-1? The maximum capacity is initialized as <code>static final int MAXIMUM_CAPACITY = 1 &lt;&lt; 30;</code></p>