### Question:
ImmutableBitSet implements Iterable<Integer>, Serializable, Comparable<ImmutableBitSet> { public ImmutableBitSet union(BitSet other) { return rebuild() .addAll(BitSets.toIter(other)) .build(); } private  ImmutableBitSet(long[] words); static ImmutableBitSet of(); static ImmutableBitSet of(int... bits); static ImmutableBitSet of(Iterable<Integer>  bits); static ImmutableBitSet of(ImmutableIntList bits); static ImmutableBitSet valueOf(long... longs); static ImmutableBitSet valueOf(LongBuffer longs); static ImmutableBitSet fromBitSet(BitSet input); static ImmutableBitSet range(int fromIndex, int toIndex); static ImmutableBitSet range(int toIndex); static Collector<Integer, ImmutableBitSet.Builder, ImmutableBitSet> toImmutableBitSet(); Iterable<ImmutableBitSet> powerSet(); boolean get(int bitIndex); ImmutableBitSet get(int fromIndex, int toIndex); @Override String toString(); boolean intersects(ImmutableBitSet set); int cardinality(); @Override int hashCode(); int size(); @Override boolean equals(Object obj); @Override int compareTo(@Nonnull ImmutableBitSet o); int nextSetBit(int fromIndex); int nextClearBit(int fromIndex); int previousClearBit(int fromIndex); @Override Iterator<Integer> iterator(); List<Integer> toList(); List<Integer> asList(); Set<Integer> asSet(); int[] toArray(); long[] toLongArray(); ImmutableBitSet union(BitSet other); ImmutableBitSet union(ImmutableBitSet other); static ImmutableBitSet union(
      Iterable<? extends ImmutableBitSet> sets); ImmutableBitSet except(ImmutableBitSet that); ImmutableBitSet intersect(ImmutableBitSet that); boolean contains(ImmutableBitSet set1); int indexOf(int bit); @SuppressWarnings("JdkObsolete") static SortedMap<Integer, ImmutableBitSet> closure(
      SortedMap<Integer, ImmutableBitSet> equivalence); int length(); boolean isEmpty(); static Builder builder(); @Deprecated // to be removed before 2.0 static Builder builder(ImmutableBitSet bitSet); Builder rebuild(); int nth(int n); ImmutableBitSet set(int i); ImmutableBitSet set(int i, boolean b); ImmutableBitSet setIf(int bit, boolean condition); ImmutableBitSet clear(int i); ImmutableBitSet clearIf(int i, boolean condition); BitSet toBitSet(); ImmutableBitSet permute(Map<Integer, Integer> map); static Iterable<ImmutableBitSet> permute(
      Iterable<ImmutableBitSet> bitSets,
      final Map<Integer, Integer> map); ImmutableBitSet shift(int offset); static boolean allContain(Collection<ImmutableBitSet> bitSets, int bit); static final Comparator<ImmutableBitSet> COMPARATOR; static final Ordering<ImmutableBitSet> ORDERING; @SuppressWarnings("Guava")
  @Deprecated // to be removed before 2.0
  static final com.google.common.base.Function<? super BitSet, ImmutableBitSet> FROM_BIT_SET; }### Answer:
@Test void testUnion() { assertThat(ImmutableBitSet.of(1).union(ImmutableBitSet.of(3)).toString(), equalTo("{1, 3}")); assertThat(ImmutableBitSet.of(1).union(ImmutableBitSet.of(3, 100)) .toString(), equalTo("{1, 3, 100}")); ImmutableBitSet x = ImmutableBitSet.of(1) .rebuild() .addAll(ImmutableBitSet.of(2)) .addAll(ImmutableBitSet.of()) .addAll(ImmutableBitSet.of(3)) .build(); assertThat(x.toString(), equalTo("{1, 2, 3}")); }