Wrap set set.

@param <T>    the type parameter
@param source the source
@return the set
356873
public static <T> Set<T> wrapSet(final T source) {
        val list = new LinkedHashSet<T>();
        if (source != null) {
            list.add(source);
        }
        return list;
    }
889694
public ImageLayer setSource (TileSource source) {
    if (source.isLoaded()) setTile(source.tile());
    else source.tileAsync().onSuccess(new Slot<Tile>() {
      public void onEmit (Tile tile) { setTile(tile); }
    });
    return this;
  }
1373777
public static <K, V> Set<Map<K, V>> setify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) {
        return (Set<Map<K, V>>) collectify(mapper, source, Set.class, targetKeyType, targetValueType);
    }
749680
public static <T> Set<T> cast(Set<?> set) {
    return set == null ? null : new CastingSet<T>(set);
  }
523146
public static ImmutableSet<Symbol> loadSymbolSet(final CharSource source) throws IOException {
    return ImmutableSet.copyOf(loadSymbolList(source));
  }
776070
public Object javaToSql(Object source)
    {
        if (source == null)
            return null;
        try
        {
            return SerializationUtils.serialize((Serializable) source);
        }
        catch(Throwable t)
        {
            throw new ConversionException(t);
        }
    }
1122938
public AnnotationTypeElementDoc wrap(AnnotationTypeElementDoc source) {
		if (source == null || source instanceof Proxy<?> || !(source instanceof AnnotationTypeElementDocImpl)) {
			return source;
		}
		return new AnnotationTypeElementDocWrapper((AnnotationTypeElementDocImpl) source);
	}
1238703
public static <T> Stream<Indexed<T>> zipWithIndex(Stream<T> source) {
        return zip(indices().mapToObj(Long::valueOf), source, Indexed::index)
                .onClose(source::close);
    }
599757
@Deprecated
    public static <T> CloseableIterable<T> wrap(final Iterable<T> iterable) {
        return fromIterable(iterable);
    }
818538
public static Set<String> getGroups(AclRuleSetSource source){
        HashSet<String> strings = new HashSet<>();
        for (AclRule rule : source.getRuleSet().getRules()) {
            if(rule.getGroup()!=null) {
                strings.add(rule.getGroup());
            }
        }
        return strings;
    }
1339467
@SuppressWarnings("unchecked")
  Map<String, Object> flatten(Map<String, Object> source) {
    Map<String, Object> result = new LinkedHashMap<>();

    for (String key : source.keySet()) {
      Object value = source.get(key);

      if (value instanceof Map) {
        Map<String, Object> subMap = flatten((Map<String, Object>) value);

        for (String subkey : subMap.keySet()) {
          result.put(key + "." + subkey, subMap.get(subkey));
        }
      } else if (value instanceof Collection) {
        StringBuilder joiner = new StringBuilder();
        String separator = "";

        for (Object element : ((Collection) value)) {
          Map<String, Object> subMap = flatten(Collections.singletonMap(key, element));
          joiner
              .append(separator)
              .append(subMap.entrySet().iterator().next().getValue().toString());

          separator = ",";
        }

        result.put(key, joiner.toString());
      } else {
        result.put(key, value);
      }
    }

    return result;
  }
1328136
@NonNull
  public static <E> ImmutableSet<E> concatSet(
      @NonNull ImmutableSet<E> set, @NonNull Iterable<E> toConcat) {
    return ImmutableSet.<E>builder().addAll(set).addAll(toConcat).build();
  }
475958
public static <T> Collector<T, Set<T>, Set<T>> toSet() {
    return Collector.of(
      HashSet::new,
      Set::add,
      (left, right) -> {
        left.addAll(right);
        return left;
      },
      ImmutableSet::copyOf);
  }
1093138
public static <T> Set<T> immutableSetConvert(Collection<? extends T> collection) {
      return immutableSetWrap(new HashSet<T>(collection));
   }
1244001
public static String encode(byte[] source, String charset) {
		return StrUtil.str(encode(source, false), charset);
	}
501174
public static <T> Set<T> copy(final Set<T> set) {
		if (set == null) {
			return null;
		}

		TypeEnum elementType = null;
		Set<T> copy = new HashSet<T>();
		for (T element : set) {
			T elementCopy = null;
			if (element != null) {
				if (elementType == null) {
					elementType = TypeEnum.dataTypeOf(element.getClass());
				}
				elementCopy = copy(element, elementType);
			}

			copy.add(elementCopy);
		}

		return copy;
	}
824503
public static Set<?> convertArrayToSet(Object[] source) {
        Set<Object> set = new HashSet<Object>();
        for (Object element : source) {
            set.add(element);
        }
        return set;
    }