Creates a union.
@return A UnionType if it has two or more alternates, the
only alternate if it has one and otherwise {@code NO_TYPE}.
480051
public JSType build() {
    if (result == null) {
      result = reduceAlternatesWithoutUnion();
      if (result == null) {
        result = new UnionType(registry, ImmutableList.copyOf(getAlternates()));
      }
    }
    return result;
  }
838883
function UnionType(attrs, opts) {
  Type.call(this);

  if (!Array.isArray(attrs)) {
    throw new Error(f('non-array union schema: %j', attrs));
  }
  if (!attrs.length) {
    throw new Error('empty union');
  }
  this._types = attrs.map(function (obj) { return createType(obj, opts); });

  this._branchIndices = {};
  this._types.forEach(function (type, i) {
    if (Type.isType(type, 'union')) {
      throw new Error('unions cannot be directly nested');
    }
    var branch = type.getName(true);
    if (this._branchIndices[branch] !== undefined) {
      throw new Error(f('duplicate union branch name: %j', branch));
    }
    this._branchIndices[branch] = i;
  }, this);
}
498804
@Nonnull
    public static <E> Set<E> union(@Nullable final Set<E> pColl1, @Nullable final Set<E> pColl2)
    {
        final Set<E> result = new HashSet<>();
        if (pColl1 != null) {
            result.addAll(pColl1);
        }
        if (pColl2 != null) {
            result.addAll(pColl2);
        }
        return Collections.unmodifiableSet(result);
    }
1349265
@Override
    public R visitUnion(UnionType t, P p) {
        return defaultAction(t, p);
    }
1214436
public void union(final HLL other) {
        // TODO: verify HLLs are compatible
        final HLLType otherType = other.getType();

        if(type.equals(otherType)) {
            homogeneousUnion(other);
            return;
        } else {
            heterogenousUnion(other);
            return;
        }
    }
877681
public final Coalesce<T> coalesce(T... args) {
        Coalesce<T> coalesce = new Coalesce<T>(getType(), mixin);
        for (T arg : args) {
            coalesce.add(arg);
        }
        return coalesce;
    }
437642
function createUnionTypeAnnotation(types) {
  var flattened = removeTypeDuplicates(types);

  if (flattened.length === 1) {
    return flattened[0];
  } else {
    return t.unionTypeAnnotation(flattened);
  }
}
999081
public AABBf union(Vector3fc p) {
        return union(p.x(), p.y(), p.z(), this);
    }
13343
public function unions(): self
    {
        $sequence = $this
            ->sorted([$this, 'sortByStartDate'])
            ->reduce([$this, 'calculateUnion'], new self())
        ;

        if ($sequence->intervals === $this->intervals) {
            return $this;
        }

        return $sequence;
    }
835568
function(or1, or2) {
			var union1 = set.union(or1.values[0], or2.values[0]);
			var union2 = set.union(or1.values[1], or2.values[1]);

			if (!isAndOrOr(union1) || !isAndOrOr(union2)) {
				return set.union(union1, union2);
			}
			union1 = set.union(or1.values[0], or2.values[1]);
			union2 = set.union(or1.values[1], or2.values[0]);

			if (!isAndOrOr(union1) || !isAndOrOr(union2)) {
				return set.union(union1, union2);
			} else {
				return new is.Or([or1, or2]);
			}
		}
591527
public QueryBuilder union() {
        this.firstQuery = query();
        this.firstQuerySetOperation = Operation.UNION;
        this.firstQueryAll = false;
        clear(false);
        return this;
    }
1205040
public Optional<ImmutableSubstitution<ImmutableTerm>> computeMGUS(ImmutableSubstitution<? extends ImmutableTerm> substitution1,
                                                                             ImmutableSubstitution<? extends ImmutableTerm> substitution2) {

        ImmutableList.Builder<ImmutableTerm> firstArgListBuilder = ImmutableList.builder();
        ImmutableList.Builder<ImmutableTerm> secondArgListBuilder = ImmutableList.builder();

        for (Map.Entry<Variable, ? extends ImmutableTerm> entry : substitution1.getImmutableMap().entrySet()) {
            firstArgListBuilder.add(entry.getKey());
            secondArgListBuilder.add(entry.getValue());
        }

        for (Map.Entry<Variable, ? extends ImmutableTerm> entry : substitution2.getImmutableMap().entrySet()) {
            firstArgListBuilder.add(entry.getKey());
            secondArgListBuilder.add(entry.getValue());
        }

        ImmutableList<ImmutableTerm> firstArgList = firstArgListBuilder.build();
        ImmutableList<ImmutableTerm> secondArgList = secondArgListBuilder.build();

        return computeMGU(firstArgList, secondArgList);
    }
188991
public static <K extends Comparable, V extends Comparable> TreeMultimap<K, V> create() {
    return new TreeMultimap<K, V>(Ordering.natural(), Ordering.natural());
  }
146843
public IslandSelection createNonConflictingVersion() {
        List<Island> possibleIslands;
        do {
            possibleIslands = selection.getPossibleIslands();
            // check the possible islands of a certain size against each other.
            if (possibleIslands.size() == 1) {
                selection.addIsland(possibleIslands.get(0));
            } else if (possibleIslands.size() > 1) {
                Map<IslandCompetition, List<Island>> analysis = analyzeConflictsBetweenPossibleIslands(possibleIslands);
                resolveConflictsBySelectingPreferredIslands(selection, analysis);
            }
        }
        while (!possibleIslands.isEmpty());
        return selection;
    }
606027
public IntBiMap union(IntBiMap other) {
    int newLength = keys.length + other.keys.length;

    int[] newKeys = Arrays.copyOf(keys, newLength);
    ArrayUtils.copy(other.keys, 0, newKeys, keys.length, other.keys.length);
    int[] newValues = Arrays.copyOf(values, newLength);
    ArrayUtils.copy(other.values, 0, newValues, values.length, other.values.length);

    return IntBiMap.fromUnsortedKeyValues(newKeys, newValues);
  }
747117
public UnionOperator<T> union(DataSet<T> other){
		return new UnionOperator<>(this, other, Utils.getCallLocationName());
	}
670434
public QueryBuilder unionAll() {
        this.firstQuery = query();
        this.firstQuerySetOperation = Operation.UNION;
        this.firstQueryAll = true;
        clear(false);
        return this;
    }