Here you can find the source of newHashMapWithCapacity(int expectedSize, float loadFactor)
public static <K, V> HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor)
//package com.java2s; //License from project: Apache License import java.util.HashMap; public class Main { public static <K, V> HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor) { int finalSize = (int) ((double) expectedSize / loadFactor + 1.0F); return new HashMap<K, V>(finalSize, loadFactor); }//w ww.j a v a2 s . co m }