NOTE
HashMap in JDK 8
Historical JDK 8 HashMap array/bin/tree design, resize concepts, load factor, and stable API-level lessons.
This is a historical learning note and may contain outdated or incomplete understanding.
JDK 8 changed HashMap internals from the older collision-chain-only model to bins that can use linked nodes and, under implementation-specific thresholds/conditions, balanced tree structures for heavy collisions.
A capacity/load-factor threshold controls when the table grows. Exact capacity rounding, treeification thresholds, field layouts, and transfer code are implementation details.
Good hash distribution remains important because collisions add work. HashMap allows one null key and null values, but it is not thread-safe for shared mutation. Rely on Map semantics and measured performance, not hard-coded JDK 8 internals.