Creates a {@code HashSet} instance containing the given elements.
Note: due to a bug in javac 1.5.0_06, we cannot support the
following:
{@code Set set = Sets.newHashSet(sub1, sub2);}
where {@code sub1} and {@code sub2} are references to subtypes of {@code
Base}, not of {@code Base} itself. To get around this, you must use:
{@code Set set = Sets.newHashSet(sub1, sub2);}
int capacity = elements.length * 4 / 3 + 1;
HashSet<E> set = new HashSet<E>(capacity);
Collections.addAll(set, elements);
return set;