code: public static <T> Set<T> getSet(Collection<T> collection) {
      Set<T> set = new LinkedHashSet<T>();
      set.addAll(collection);
  
      return set;
    }
docs: Convert Collection to Set
  @param collection Collection
  @return Set