Creates a HashMap instance, with a high enough "initial capacity" that it should hold expectedSize elements without growth. This behavior cannot be broadly guaranteed, but it is observed to be true for OpenJDK 1.7. It also can't be guaranteed that the method isn't inadvertentl
(int expectedSize)
| 192 | |
| 193 | |
| 194 | public static <K, V> HashMap<K, V> newHashMapWithExpectedSize(int expectedSize) { |
| 195 | return new HashMap<K, V>(capacity(expectedSize)); |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * Returns a capacity that is sufficient to keep the map from being resized as |
no test coverage detected