According to JDK-8003585, we can strength-reduce the array range check in HashMap.getEntry to a simple check whether table.length is zero or not.
A side effect of this is that an explicit zero check in this place has no additional cost, since it is done implicitly. Therefore code to lazily create tables has little or no downside, if the "lazy" state is a zero-length table.
This is better than using a null pointer as a sentinel for an unallocated table, because it does not force the compiler to deal with the null case.
(The compiler prefers to use "implicit" null checks, which are a side effect of taking a SEGV trap when loading through an address that is assumed to be non-null.)