see {@link InheritableThreadLocal#set}
960819
@Override
    public final void set(T value) {
        super.set(value);
        // may set null to remove value
        if (null == value) removeValue();
        else addValue();
    }
201600
public @Nonnull SetType getBlockedThreads() {
        Set<ThreadType> blocked = new LinkedHashSet<ThreadType>();
        for (ThreadType thread: runtime.getThreads()) {
            if (thread == this) continue;
            if (getAcquiredLocks().contains(thread.getWaitingToLock())) {
                blocked.add(thread);
            }
        }
        return runtime.getThreadSet(blocked);
    }
783840
public void addAll(Set<? extends E> set) {
		if(set.size()<=MAXIMUM_COMBINE_SIZE) {
			if(combined==null) combined = new HashSet<>(set);
			else combined.addAll(set);
		} else {
			added.add(set);
		}
	}
851371
@Override
    public ImmutableSet<Cell<V>> cells() {
        ImmutableSet<Cell<V>> c = cellSet;
        if (c == null) {
            c = ImmutableSet.copyOf(cells);
            cellSet = c;
        }
        return c;
    }
994982
@Override
    public Set<K> keySet() {
        final Set<K> localSet = this.localMap.keySet();

        if (isReadyOnly())
            return Collections.unmodifiableSet(localSet);

        return localSet;
    }
402031
protected final Set<?> set(Object... datas) {
    Set<Object> items = CollectUtils.newHashSet();
    for (Object obj : datas) {
      if (obj instanceof Class<?>) {
        items.add(buildInnerReference((Class<?>) obj));
      } else {
        items.add(obj);
      }
    }
    return items;
  }
852099
public synchronized Set<String> keySet() {
		if(size == 0) {
			return new HashSet<String>(0);
		} else {
			try {
				XAttributeMap map = deserialize();
				return map.keySet();
			} catch (IOException e) {
				e.printStackTrace();
				return null;
			}
		}
	}
603689
public static <T> Set<T> asImmutable(Set<? extends T> self) {
        return Collections.unmodifiableSet(self);
    }
639757
@SuppressWarnings(UNCHECKED)
    protected Set<E> set(Query query)
    {
        return new HashSet<E>(query.list());
    }
749680
public static <T> Set<T> cast(Set<?> set) {
    return set == null ? null : new CastingSet<T>(set);
  }
56556
@NotNull
    public static <T> Collector<T, ?, Set<T>> toSet() {
        return new CollectorsImpl<T, Set<T>, Set<T>>(

                new Supplier<Set<T>>() {
                    @NotNull
                    @Override
                    public Set<T> get() {
                        return new HashSet<T>();
                    }
                },

                new BiConsumer<Set<T>, T>() {
                    @Override
                    public void accept(@NotNull Set<T> set, T t) {
                        set.add(t);
                    }
                }
        );
    }
320047
public @Nonnull SetType where(ProcessThread.Predicate pred) {
        HashSet<ThreadType> subset = new HashSet<ThreadType>(size() / 2);
        for (ThreadType thread: threads) {
            if (pred.isValid(thread)) subset.add(thread);
        }

        return runtime.getThreadSet(subset);
    }
1043847
public static <E, S extends SortedSet<E>> SynchronizedSortedSet<E> of(S set)
    {
        return new SynchronizedSortedSet<E>(SortedSetAdapter.adapt(set));
    }
1324598
public static final <T> Set<T> union(Collection<Set<T>> sets)
    {
        Set<T> set = new HashSet<>();
        for (Set<T> s : sets)
        {
            set.addAll(s);
        }
        return set;
    }
898332
@Inline(value="$2.$3copyOf($1)", imported=ImmutableSet.class)
	public static <T> Set<T> immutableCopy(Set<? extends T> set) {
		return ImmutableSet.copyOf(set);
	}
245177
function Set() {
            var set = this;
            set = emulateES6construct(set);
            if (!set._es6set) {
              throw new TypeError('bad set');
            }

            defineProperties(set, {
              '[[SetData]]': null,
              '_storage': emptyObject()
            });

            // Optionally initialize map from iterable
            var iterable = arguments[0];
            if (iterable !== undefined && iterable !== null) {
              var it = ES.GetIterator(iterable);
              var adder = set.add;
              if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
              while (true) {
                var next = ES.IteratorNext(it);
                if (next.done) { break; }
                var nextItem = next.value;
                adder.call(set, nextItem);
              }
            }
            return set;
          }
455228
protected Set<Entry<ADDRESST, EventListener>> listenersEntrySet() {
		final Object mutex = mutex();
		synchronized (mutex) {
			return Collections3.synchronizedSet(this.listeners.entrySet(), mutex);
		}
	}