code: public static <E> HashSet<E> newHashSet(Iterable<? extends E> elements) {
      return (elements instanceof Collection)
          ? new HashSet<E>(Collections2.cast(elements))
          : newHashSet(elements.iterator());
    }
docs: Creates a <i>mutable</i> {@code HashSet} instance containing the given elements. A very thin
  convenience for creating an empty set then calling {@link Collection#addAll} or {@link
  Iterables#addAll}.
  
  <p><b>Note:</b> if mutability is not required and the elements are non-null, use {@link
  ImmutableSet#copyOf(Iterable)} instead. (Or, change {@code elements} to be a {@link
  FluentIterable} and call {@code elements.toSet()}.)
  
  <p><b>Note:</b> if {@code E} is an {@link Enum} type, use {@link #newEnumSet(Iterable, Class)}
  instead.
  
  <p><b>Note for Java 7 and later:</b> if {@code elements} is a {@link Collection}, you don't
  need this method. Instead, use the {@code HashSet} constructor directly, taking advantage of
  the new <a href="http://goo.gl/iz2Wi">"diamond" syntax</a>.
  
  <p>Overall, this method is not very useful and will likely be deprecated in the future.