public static <E> HashSet<E> newHashSetWithCapacity(int capacity) {
    return new HashSet<E>(capacity);
  }
Creates a {@code HashSet} instance, with a high enough "initial capacity" that it <i>should</i>
hold {@code expectedSize} elements without growth. This behavior cannot be broadly guaranteed,
but it is observed to be true for OpenJDK 1.6. It also can't be guaranteed that the method
isn't inadvertently <i>oversizing</i> the returned set.

@param capacity the number of elements you expect to add to the returned set
@return a new, empty {@code HashSet} with enough capacity to hold {@code expectedSize} elements
    without resizing
@throws IllegalArgumentException if {@code expectedSize} is negative
fbcore/src/main/java/com/facebook/common/internal/Sets.java