code: @Nonnegative
    public static int arraySize (final int nExpected, final float fLoadFactor)
    {
      final long s = Math.max (2, nextPowerOfTwo ((long) Math.ceil (nExpected / fLoadFactor)));
      if (s > (1 << 30))
        throw new IllegalArgumentException ("Too large (" +
                                            nExpected +
                                            " expected elements with load factor " +
                                            fLoadFactor +
                                            ")");
      return (int) s;
    }
docs: Returns the least power of two smaller than or equal to 2<sup>30</sup> and
  larger than or equal to <code>Math.ceil( expected / f )</code>.
  
  @param nExpected
  the expected number of elements in a hash table.
  @param fLoadFactor
  the load factor.
  @return the minimum possible size for a backing array.
  @throws IllegalArgumentException
  if the necessary size is larger than 2<sup>30</sup>.