code: public static <T> Set<T> toSet(final Collection<T> collection) {
  
          if (isEmpty(collection)) {
              return new HashSet<T>(0);
          } else {
              return new HashSet<T>(collection);
          }
      }
docs: Convert given collection to a set.
  
  @param collection
  source collection.
  @return a set has all unique element of given collection.