### Question:
ObjectSet implements /*Serializable,*/ Iterable<Long> { public boolean union(ObjectSet otherSet) { if (stripeWidth != otherSet.stripeWidth || firstObjectNo != otherSet.firstObjectNo) throw new IllegalArgumentException( "The sets are not compatible. They must have the same stripe width and first object number."); int previousLength = objects.cardinality(); objects.or(otherSet.objects); return (objects.cardinality() != previousLength) ? true : false; } ObjectSet();  ObjectSet(int initialSize);  ObjectSet(int stripeWidth, int firstObjectNo);  ObjectSet(int stripeWidth, int firstObjectNo, int initialSize);  ObjectSet(int stripeWidth, int firstObjectNo, byte[] serializedBitSet);  ObjectSet(ObjectSet objectSet); boolean add(Long object); boolean contains(Long object); Long getFirst(); Long getRandom(); Iterator<Long> iterator(); boolean remove(Long object); boolean isEmpty(); int size(); void clear(); boolean equals(Object obj); boolean intersection(ObjectSet otherSet); boolean union(ObjectSet otherSet); boolean complement(int lastObject); @Override String toString(); @Override ObjectSet clone(); int getStripeWidth(); int getFirstObjectNo(); byte[] getSerializedBitSet(); static final int DEFAULT_INITIAL_SIZE; }### Answer:
@Test public void testUnion() throws Exception { long[] objectsInList1 = { 10, 20, 40, 50, 60, 70, 80, 100 }; long[] objectsInList2 = { 0, 30, 50, 70, 90, 100 }; long[] union = { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; for (ObjectSet set : fixedSets) for (long object : objectsInList2) set.add(object); for (ObjectSet set2 : fixedSets) { for (ObjectSet set : changeableSets) { set.clear(); for (long object : objectsInList1) set.add(object); set.union(set2); assertEquals(union.length, set.size()); for (long object : union) assertTrue(set.contains(object)); } } }