Returns a {@link Lexicon} instance that's a union of {@code this} and {@code that}.
485274
Lexicon union(Lexicon that) {
    return new Lexicon(fallback(words, that.words), Parsers.or(tokenizer, that.tokenizer));
  }
824738
def union(self, other):
        """"""
        x = SetLikeDict(**self)
        x.update(other)
        return x
852906
public void merge(BloomKFilter that)
  {
    if (this != that && this.m == that.m && this.k == that.k) {
      this.bitSet.putAll(that.bitSet);
    } else {
      throw new IllegalArgumentException("BloomKFilters are not compatible for merging." +
                                         " this - " + this + " that - " + that);
    }
  }
655556
public AsciiSet union(AsciiSet set) {
    final boolean[] unionMembers = new boolean[128];
    for (int i = 0; i < unionMembers.length; ++i) {
      unionMembers[i] = members[i] || set.members[i];
    }
    return new AsciiSet(unionMembers);
  }
944139
public AndCondition copy() {
        AndCondition builder = new AndCondition();
        builder.children.addAll(children);
        return builder;
    }
206659
private LocalVariableDefinition buildUnion(MethodDefinition read, Map<Short, LocalVariableDefinition> unionData)
    {
        // construct the instance and store it in the instance local variable
        LocalVariableDefinition instance = constructUnionInstance(read);

        // switch (fieldId)
        read.loadVariable("fieldId");

        List<CaseStatement> cases = new ArrayList<>();
        for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
            cases.add(caseStatement(field.getId(), field.getName() + "-inject-field"));
        }
        read.switchStatement("inject-default", cases);

        for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
            // case field.id:
            read.visitLabel(field.getName() + "-inject-field");

            injectField(read, field, instance, unionData.get(field.getId()));

            if (field.getMethodInjection().isPresent()) {
                injectMethod(read, field.getMethodInjection().get(), instance, unionData);
            }

            read.gotoLabel("inject-default");
        }

        // default case
        read.visitLabel("inject-default");

        // find the @ThriftUnionId field
        ThriftFieldMetadata idField = getOnlyElement(metadata.getFields(THRIFT_UNION_ID));

        injectIdField(read, idField, instance, unionData);

        // invoke factory method if present
        invokeFactoryMethod(read, unionData, instance);

        return instance;
    }
444682
public static <T> String join(Iterator<T> iterator, CharSequence conjunction) {
		return IterUtil.join(iterator, conjunction);
	}
704011
public T copyIntoAnonymousSubclass() {
        T copy = Instantiator.of(type).instantiateAnonymousSubclass();
        return copyInto(copy);
    }
1165433
public static <T> String join(Iterable<T> iterable, CharSequence conjunction) {
		return IterUtil.join(iterable, conjunction);
	}
986359
@SuppressWarnings("unchecked")
  public static <E, C extends Counter<E>> C union(C c1, C c2) {
    C result = (C) c1.getFactory().create();
    addInPlace(result, c1);
    addInPlace(result, c2);
    return result;
  }
462065
def union(other)
      if other.is_a?(RelativeComplement)
        # A ∪ ¬B = ¬B ∪ A
        other.union(self)
      elsif other.is_a?(AbstractSet)
        unless other.is_a?(RelativeSet) and size < other.size
          hash = other.inject(@hash.clone){|h,o| h[o] = true; h }

          if hash.empty?
            NullSet.build
          else
            RelativeSet.new(hash)
          end
        else
          # For efficiency, iterate the smaller of the two sets: A ∪ B = B ∪ A
          if other.empty?
            self
          else
            other.union(self)
          end
        end
      else
        union(Cantor.build(other))
      end
    end
77911
public static Annotation[] union(Annotation[] a, Annotation[] b) {
        // fast path
        if (a.length==0)    return b;
        if (b.length==0)    return a;

        // slow path
        List<Annotation> combined = new ArrayList<Annotation>(a.length+b.length);
        combined.addAll(Arrays.asList(a));

        OUTER:
        for (Annotation x : b) {
            for (int i=0; i<a.length; i++) {
                if (x.annotationType()==combined.get(i).annotationType()) {
                    combined.set(i,x);  // override
                    continue OUTER;
                }
            }
            // not overlapping. append
            combined.add(x);
        }

        return combined.toArray(new Annotation[combined.size()]);
    }
607561
@Override
    public ImmutableSubstitution<ImmutableTerm> composeWith(ImmutableSubstitution<? extends ImmutableTerm> f) {
        if (isEmpty()) {
            return (ImmutableSubstitution<ImmutableTerm>)f;
        }
        if (f.isEmpty()) {
            return (ImmutableSubstitution<ImmutableTerm>)this;
        }

        Map<Variable, ImmutableTerm> substitutionMap = new HashMap<>();

        /**
         * For all variables in the domain of f
         */

        for (Map.Entry<Variable, ? extends ImmutableTerm> gEntry :  f.getImmutableMap().entrySet()) {
            substitutionMap.put(gEntry.getKey(), apply(gEntry.getValue()));
        }

        /**
         * For the other variables (in the local domain but not in f)
         */
        for (Map.Entry<Variable, ? extends ImmutableTerm> localEntry :  getImmutableMap().entrySet()) {
            Variable localVariable = localEntry.getKey();

            if (substitutionMap.containsKey(localVariable))
                continue;

            substitutionMap.put(localVariable, localEntry.getValue());
        }

        return substitutionFactory.getSubstitution(
                substitutionMap.entrySet().stream()
                        // Clean out entries like t/t
                        .filter(entry -> !entry.getKey().equals(entry.getValue()))
                        .collect(ImmutableCollectors.toMap()));
    }
50501
public FunctionList union(FunctionList that) {
        Set<Function> combined = new LinkedHashSet<Function>();
        combined.addAll(Arrays.asList(this.functions));
        combined.addAll(Arrays.asList(that.functions));
        return new FunctionList(combined);
    }
199945
public Curies mergeWith(final Curies other) {
        final Curies merged = copyOf(this);
        other.curies.forEach(merged::register);
        return merged;
    }
484086
public static <A, B> These<A, B> b(B b) {
        return new _B<>(b);
    }
729043
public static Collector<CharSequence, ?, String> joining() {
        return new CollectorImpl<CharSequence, StringBuilder, String>(
                StringBuilder::new, StringBuilder::append,
                (r1, r2) -> { r1.append(r2); return r1; },
                StringBuilder::toString, CH_NOID);
    }