all the capacities will be used to initialize HashMaps so they should be powers of two
485060
private void ensurePowerOfTwo(String parameter, int number) {
        if (Integer.bitCount(number) > 1) {
            LOG.warn("Parameter {} should be power of two but was {}", parameter, number);
        }
    }
84968
private static int capacity(int expectedSize) {
		if (expectedSize < 3) {
			Preconditions.checkArgument(expectedSize >= 0);
			return expectedSize + 1;
		}
		if (expectedSize < Ints.MAX_POWER_OF_TWO) {
			return expectedSize + expectedSize / 3;
		}
		return Integer.MAX_VALUE; // any large value
	}
1094988
final void putMapEntries(Map<? extends K, ? extends V> m, boolean evict) {
        int s = m.size();
        if (s > 0) {
            if (table == null) { // pre-size
                float ft = ((float)s / loadFactor) + 1.0F;
                int t = ((ft < (float)MAXIMUM_CAPACITY) ?
                         (int)ft : MAXIMUM_CAPACITY);
                if (t > threshold)
                    threshold = tableSizeFor(t);
            }
            else if (s > threshold)
                resize();
            for (Map.Entry<? extends K, ? extends V> e : m.entrySet()) {
                K key = e.getKey();
                V value = e.getValue();
                putVal(hash(key), key, value, false, evict);
            }
        }
    }
198526
@SuppressWarnings("unchecked")
    private void ensureCapacity(int capacity) {
        checkCapacity(capacity);
        Elem<V>[] newArray = (Elem<V>[]) Array.newInstance(Elem.class, capacity + 2);
        if (newArray.length >= array.length) {
            System.arraycopy(array, 0, newArray, 0, array.length);
            for (int i = array.length; i < newArray.length; i++) {
                newArray[i] = new Elem<V>(SUP_KEY, null);
            }
        } else {
            System.arraycopy(array, 0, newArray, 0, newArray.length);
        }
        array = newArray;
    }
1143764
public static <K, V> HashMap<K, V> newHashMap(int size, boolean isOrder) {
		return MapUtil.newHashMap(size, isOrder);
	}
1076917
function (i, p) {
  var even = evenSeed(i, p);
  return [Math.pow(2, p) + 1 - even, even];
}
1117072
public static <K> HashMap<K, MutableLong> createMutableLongValueMap(int initialCapacity, float loadFactor) {
		return new HashMap<K, MutableLong>(initialCapacity, loadFactor);
	}
77071
private void init(int initCapacity) {
        assert (initCapacity & -initCapacity) == initCapacity; // power of 2
        assert initCapacity >= MINIMUM_CAPACITY;
        assert initCapacity <= MAXIMUM_CAPACITY;

        threshold = (initCapacity * 3)/ 4;
        table = new long[2 * initCapacity];
    }
718861
public static <K, V> ArrayMap<K, V> create(int initialCapacity) {
    ArrayMap<K, V> result = create();
    result.ensureCapacity(initialCapacity);
    return result;
  }
131099
function equalSimpleMaps(map1, map2) {

	const keys1 = (map1 && Object.keys(map1));
	if (map1 && (keys1.length > 0)) {
		const keys2 = (map2 && Object.keys(map2));
		return (
			keys2 &&
				(keys2.length === keys1.length) &&
				keys2.every(k => (map2[k] === map1[k]))
		);
	}

	return (!map2 || (Object.keys(map2).length === 0));
}
740027
public static <E> Set<E> createLinkedHashSet(int expectedMapSize) {
        final int initialCapacity = (int) (expectedMapSize / HASHSET_DEFAULT_LOAD_FACTOR) + 1;
        return new LinkedHashSet<E>(initialCapacity, HASHSET_DEFAULT_LOAD_FACTOR);
    }
352017
public int size(final K1 firstKey, final K2 secondKey) {
		// existence check on inner map
		final HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey);
		if( innerMap1 == null ) {
			return 0;
		}
		
		// existence check on inner map1
		final HashMap<K3, V> innerMap2 = innerMap1.get(secondKey);
		if( innerMap2 == null ) {
			return 0;
		}
		return innerMap2.size();
	}
455081
@SafeVarargs
	public static <T> HashSet<T> newHashSet(boolean isSorted, T... ts) {
		if (null == ts) {
			return isSorted ? new LinkedHashSet<T>() : new HashSet<T>();
		}
		int initialCapacity = Math.max((int) (ts.length / .75f) + 1, 16);
		HashSet<T> set = isSorted ? new LinkedHashSet<T>(initialCapacity) : new HashSet<T>(initialCapacity);
		for (T t : ts) {
			set.add(t);
		}
		return set;
	}
111037
public static <T, K, V, P> HashMap<K, HashMap<P, V>> matrix(
			Collection<T> entities, Function<T, K> keyMapper1,
			Function<T, P> keyMapper2, Function<T, V> valueMapper) {
		if (entities == null)
			return null;
		return entities.stream().collect(
				Collectors.groupingBy(keyMapper1, HashMap::new, Collectors
						.toMap(keyMapper2, valueMapper, (a, b) -> a,
								HashMap::new)));
	}
1290075
private void allocateElements(int numElements) {
        int initialCapacity = MIN_INITIAL_CAPACITY;
        // Find the best power of two to hold elements.
        // Tests "<=" because arrays aren't kept full.
        if (numElements >= initialCapacity) {
            initialCapacity = numElements;
            initialCapacity |= (initialCapacity >>>  1);
            initialCapacity |= (initialCapacity >>>  2);
            initialCapacity |= (initialCapacity >>>  4);
            initialCapacity |= (initialCapacity >>>  8);
            initialCapacity |= (initialCapacity >>> 16);
            initialCapacity++;

            if (initialCapacity < 0)    // Too many elements, must back off
                initialCapacity >>>= 1; // Good luck allocating 2^30 elements
        }
        elements = new Object[initialCapacity];
    }
955966
@SuppressWarnings("unused")
	public static void main(String[] args) {
		if (false) {
			long capacity = 1;
			int count = 1;
			while (capacity < Integer.MAX_VALUE) {
				capacity = java.math.BigInteger.valueOf(capacity).nextProbablePrime().longValue();
				System.out.print(capacity + ", ");
				final double inc = Math.log(2) / Math.log(capacity << 5) * 10 + 1;
				// System.out.println(inc);
				capacity *= inc;
				if (count % 5 == 0) {
					System.out.println();
				}
				count++;
			}
			System.out.println(Integer.MAX_VALUE);
			System.out.println("------");

			System.out.println(count);
			System.out.println(PrimeFinder.nextPrime((int) 1e6));
		}
		if (true) {
			IntHashMap<Integer> hash = new IntHashMap<Integer>(16, Integer.class);
			hash.put(1, 2);
			hash.put(2, 4);
			for (Integer i : hash.getValues()) {
				System.out.println(i);
			}
		}
	}
741357
public static <E> Set<Set<E>> powerSet(Set<E> s) {
    if (s.isEmpty()) {
      Set<Set<E>> h = new HashSet<Set<E>>();
      Set<E> h0 = new HashSet<E>(0);
      h.add(h0);
      return h;
    } else {
      Iterator<E> i = s.iterator();
      E elt = i.next();
      s.remove(elt);
      Set<Set<E>> pow = powerSet(s);
      Set<Set<E>> pow1 = powerSet(s);
      // for (Iterator j = pow1.iterator(); j.hasNext();) {
      for (Set<E> t : pow1) {
        // Set<E> t = new HashSet<E>((Set<E>) j.next());
        t.add(elt);
        pow.add(t);
      }
      s.add(elt);
      return pow;
    }
  }