code: public static <E> HashSet<E> asHashSet(final Collection<E> c) {
          if (noItems(c)) {
              return new HashSet<E>();
          }
          return new HashSet<E>(c);
      }
docs: Returns a hash set of type {@code E} optimized to the
  {@link Collection#size() size} of the supplied {@link Collection
  collection}.
  
  @param <E> Formal type parameter collection element
  @param c {@link Collection}; may be null
  @return Hash set of type {@code E}