util-common/src/main/java/io/activej/common/Utils.java
/**
	 * Returns a union of two sets
	 * <p>
	 * No guarantee on a mutability of a resulting set is made,
	 * so set should be considered unmodifiable
	 * <p>
	 * If any of provided sets is modified, the behaviour of a resulting set is undefined
	 */
Returns a union of two sets

No guarantee on a mutability of a resulting set is made,
so set should be considered unmodifiable

If any of provided sets is modified, the behaviour of a resulting set is undefined
Returns a union of two sets No guarantee on a mutability of a resulting set is made so set should be considered unmodifiable If any of provided sets is modified the behaviour of a resulting set is undefined
@SuppressWarnings("unchecked")
	public static <T> Set<T> union(Set<? extends T> a, Set<? extends T> b) {
		if (a.isEmpty()) return (Set<T>) b;
		if (b.isEmpty()) return (Set<T>) a;
		Set<T> result = new HashSet<>(max(a.size(), b.size()));
		result.addAll(a);
		result.addAll(b);
		return result;
	}
@ SuppressWarnings ( "unchecked" ) public static < T > Set < T > union ( Set < ? extends T > a , Set < ? extends T > b ) { if ( a . isEmpty ( ) ) return ( Set < T > ) b ; if ( b . isEmpty ( ) ) return ( Set < T > ) a ; Set < T > result = new HashSet < > ( max ( a . size ( ) , b . size ( ) ) ) ; result . addAll ( a ) ; result . addAll ( b ) ; return result ; }
Returns a union of two sets
 <p>
 No guarantee on a mutability of a resulting set is made,
 so set should be considered unmodifiable
 <p>
 If any of provided sets is modified, the behaviour of a resulting set is undefined
Returns a union of two sets <p > No guarantee on a mutability of a resulting set is made so set should be considered unmodifiable <p > If any of provided sets is modified the behaviour of a resulting set is undefined