OrSet implements CrdtAddRemoveSet<E, Set<E>, OrSet<E>> { @Override public OrSet<E> merge(OrSet<E> other) { return new OrSet<E>(this, other); } OrSet();   OrSet(Map<E, Set<UUID>> elements, Map<E, Set<UUID>> tombstones); @SafeVarargs  OrSet(E ... elements);  OrSet(Set<E> elements);  OrSet(Builder<E>builder);  OrSet(OrSet<E> set, Builder<E> builder);  OrSet(OrSet<E> left, OrSet<E> right); OrSet<E> add(E e); OrSet<E> remove(E e); OrSet.Builder<E> builder(); @Override OrSet<E> merge(OrSet<E> other); @Override Set<E> value(); @Override OrSet<E> optimize(); int size(); boolean isEmpty(); boolean contains(Object o); Iterator<E> iterator(); Object[] toArray(); T[] toArray(T[] a); boolean containsAll(Collection<?> c); boolean addAll(Collection<? extends E> c); boolean retainAll(Collection<?> c); boolean removeAll(Collection<?> c); void clear(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void mergeTest(){ OrSet<Integer> i = new OrSet<>(new OrSet.Builder<Integer>().add(4).add(5).add(6).remove(5)); Assert.assertArrayEquals(Arrays.asList(4, 6).toArray(), i.value().toArray()); OrSet<Integer> j = new OrSet<>(new OrSet.Builder<Integer>().add(9).add(4).add(5).remove(6)); OrSet<Integer> h = i.merge(j); Assert.assertEquals(new OrSet<>(4, 6, 9, 5), h); }