Returns an immutable empty set if the specified Set is <code>null</code>, otherwise itself is returned.

@param set
@return
488951
public static <T> Set<T> nullToEmpty(final Set<T> set) {
        return set == null ? N.<T> emptySet() : set;
    }
174092
@SuppressWarnings("unchecked") // Empty immutable collection is safe to cast.
  public static <K, V> HamtPMap<K, V> empty() {
    return (HamtPMap<K, V>) EMPTY;
  }
1302964
@SafeVarargs
    public static <T> Set<T> of(T... elements) {
        Preconditions.checkNotNull(elements);
        return ImmutableSet.<T> builder().addAll(elements).build();
    }
1099761
public static <T> Set<T> toImmutableSet(final Set<? extends T> set) {
    switch (set.size()) {
      case 0:
        return Collections.emptySet();
      case 1:
        return Collections.singleton(set.iterator().next());
      default:
        return Collections.unmodifiableSet(set);
    }
  }
1184621
public static <E, S extends Set<E>> UnmodifiableMutableSet<E> of(S set)
    {
        if (set == null)
        {
            throw new IllegalArgumentException("cannot create an UnmodifiableMutableSet for null");
        }
        return new UnmodifiableMutableSet<E>(SetAdapter.adapt(set));
    }
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);
  }
1299560
public Set<T> internAll(Set<T> s) {
    synchronized(mutex) {
      return delegate.internAll(s);
    }
  }
989940
public boolean isValueSet(String s) {
        return (s != null && s.trim().isEmpty() == false) ? true : false;
    }
147644
public final Set<V> getValues(K key) {
	Set<V> set = _getValues(key);
	if(set == null)
	    return Collections.emptySet();
	else 
	    return Collections.unmodifiableSet(set);
    }
603689
public static <T> Set<T> asImmutable(Set<? extends T> self) {
        return Collections.unmodifiableSet(self);
    }
1206120
public static <E, S extends SortedSet<E>> UnmodifiableSortedSet<E> of(S set)
    {
        if (set == null)
        {
            throw new IllegalArgumentException("cannot create an UnmodifiableSortedSet for null");
        }
        return new UnmodifiableSortedSet<E>(SortedSetAdapter.adapt(set));
    }
1346929
public static <T> Set<T> newSet(T...contents)
	{
		Set<T> set;

		if(contents == null || contents.length==0)
			return newSet();
		set = newSet(contents.length);
		Collections.addAll(set, contents);
		return set;
	}
1046489
static <T> Set<T> freeze(Set<T> set) {
        return set == null ? null : Collections.unmodifiableSet(set);
    }
552434
public Set<V> get(K key) {
        checkNotNull(key, "Key cannot be null");
        return backingMap.get(key);
    }
814497
public <E> Set<E> unmodifiable(Set<E> input)
    {
        if (input == null) {
            return null;
        }
        return Collections.unmodifiableSet(input);
    }
425651
public static <T> ImmutableSet<ImmutableSet<T>> immutablePowerSet(Set<T> set)
    {
        return powerSet(set).collect(new Function<MutableSet<T>, ImmutableSet<T>>()
        {
            public ImmutableSet<T> valueOf(MutableSet<T> set)
            {
                return set.toImmutable();
            }
        }).toImmutable();
    }
83446
public static String serializeSet(Set<?> set) {
        if (set == null) {
            set = new HashSet<String>();
        }
        XStream xstream = new XStream(new DomDriver());
        return xstream.toXML(set);
    }