default <T> HashSet<T> delegateHashSet(Iterable<M> spaces, Function<M, Collection<T>> func) {
		try (LockHold hold = LockHold.lock(readLock())) {
			HashSet<T> result = new HashSet<>();
			for (M m : spaces) {
				result.addAll(func.apply(m));
			}
			return result;
		}
	}
Compose a set, immediately, from collections returned by delegates

@param spaces the delegates
@param func a collection (usually a set) getter for each delegate
@return the unioned results
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/space/DBTraceDelegatingManager.java