MergedOTSystem implements OTSystem<D> { @Override public boolean isEmpty(D op) { for (D1 operation : getter1.apply(op)) { if (!otSystem1.isEmpty(operation)) { return false; } } for (D2 operation : getter2.apply(op)) { if (!otSystem2.isEmpty(operation)) { return false; } } return true; } private  MergedOTSystem(TupleConstructor2<List<D1>, List<D2>, D> constructor,
			Function<D, List<D1>> getter1, OTSystem<D1> otSystem1,
			Function<D, List<D2>> getter2, OTSystem<D2> otSystem2); static OTSystem<D> mergeOtSystems(TupleConstructor2<List<D1>, List<D2>, D> constructor,
			Function<D, List<D1>> getter1, OTSystem<D1> otSystem1,
			Function<D, List<D2>> getter2, OTSystem<D2> otSystem2); static OTSystem<D> mergeOtSystems(TupleConstructor3<List<D1>, List<D2>, List<D3>, D> constructor,
			Function<D, List<D1>> getter1, OTSystem<D1> otSystem1,
			Function<D, List<D2>> getter2, OTSystem<D2> otSystem2,
			Function<D, List<D3>> getter3, OTSystem<D3> otSystem3); static OTSystem<D> mergeOtSystems(TupleConstructor4<List<D1>, List<D2>, List<D3>, List<D4>, D> constructor,
			Function<D, List<D1>> getter1, OTSystem<D1> otSystem1,
			Function<D, List<D2>> getter2, OTSystem<D2> otSystem2,
			Function<D, List<D3>> getter3, OTSystem<D3> otSystem3,
			Function<D, List<D4>> getter4, OTSystem<D4> otSystem4); static OTSystem<D> mergeOtSystems(TupleConstructor5<List<D1>, List<D2>, List<D3>, List<D4>, List<D5>, D> constructor,
			Function<D, List<D1>> getter1, OTSystem<D1> otSystem1,
			Function<D, List<D2>> getter2, OTSystem<D2> otSystem2,
			Function<D, List<D3>> getter3, OTSystem<D3> otSystem3,
			Function<D, List<D4>> getter4, OTSystem<D4> otSystem4,
			Function<D, List<D5>> getter5, OTSystem<D5> otSystem5); @Override TransformResult<D> transform(List<? extends D> leftDiffs, List<? extends D> rightDiffs); @Override List<D> squash(List<? extends D> ops); @Override boolean isEmpty(D op); @Override List<D> invert(List<O> ops);  }
@Test public void testIsEmpty() { assertTrue(MERGED.isEmpty(ops(null, null, null))); assertTrue(MERGED.isEmpty(ops(add(0), null, null))); assertTrue(MERGED.isEmpty(ops(null, set(12, 12), null))); assertTrue(MERGED.isEmpty(ops(null, null, setName("test", "test")))); assertTrue(MERGED.isEmpty(ops(add(0), set(12, 12), setName("test", "test")))); assertFalse(MERGED.isEmpty(ops(add(1), null, null))); assertFalse(MERGED.isEmpty(ops(null, set(12, 13), null))); assertFalse(MERGED.isEmpty(ops(null, null, setName("test", "test1")))); assertFalse(MERGED.isEmpty(ops(add(1), set(12, 12), setName("test", "test")))); assertFalse(MERGED.isEmpty(ops(add(0), set(12, 13), setName("test", "test")))); assertFalse(MERGED.isEmpty(ops(add(0), set(12, 12), setName("test", "test1")))); assertFalse(MERGED.isEmpty(ops(add(1), set(12, 13), setName("test", "test1")))); }