public static <T> Set<T> asSet(Iterable<T> iterable) {
		if (iterable instanceof Set) {
			return (Set<T>) iterable;
		}

		Set<T> set = new HashSet<>();
		if (iterable == null) {
			return set;
		}

		Iterator<T> it = iterable.iterator();
		while (it.hasNext()) {
			T t = it.next();
			set.add(t);
		}
		return set;
	}
Turns the given iterable into a new Set, returning it directly if it is a set, draining
it into a set if it is not already.

@param iterable the iterable
@return the set
Ghidra/Framework/Generic/src/main/java/util/CollectionUtils.java