android/guava/src/com/google/common/collect/Sets.java
public static <E> HashSet<E> newHashSetWithExpectedSize(int expectedSize) {
    return new HashSet<E>(Maps.capacity(expectedSize));
  }
public static <E> HashSet<E> newHashSetWithExpectedSize(int expectedSize) {
    return new HashSet<E>(Maps.capacity(expectedSize));
  }
Returns a new hash set using the smallest initial table size that can hold {@code expectedSize}
elements without resizing. Note that this is not what {@link HashSet#HashSet(int)} does, but it
is what most users want and expect it to do.

<p>This behavior can't be broadly guaranteed, but has been tested with OpenJDK 1.7 and 1.8.

@param expectedSize the number of elements you expect to add to the returned set
@return a new, empty hash set with enough capacity to hold {@code expectedSize} elements
without resizing
@throws IllegalArgumentException if {@code expectedSize} is negative