Here you can find the source of hashMapCapacity(final int nElements)
public static int hashMapCapacity(final int nElements)
//package com.java2s; //License from project: Open Source License public class Main { /** return a good initialCapacity for a HashMap that will hold a given number of elements */ public static int hashMapCapacity(final int nElements) { return (int) ((nElements * 4L) / 3) + 1; }/*w w w . j a v a 2 s. c o m*/ }