left.writeGlobal(CounterId.fromInt(1), 1L, 1L);
left.writeGlobal(CounterId.fromInt(2), 2L, 2L);
left.writeGlobal(CounterId.fromInt(3), 3L, 3L);
right = ContextState.allocate(3, 0, 0, allocator);
right.writeGlobal(CounterId.fromInt(3), 6L, 6L);
right.writeGlobal(CounterId.fromInt(4), 4L, 4L);
right.writeGlobal(CounterId.fromInt(5), 5L, 5L);
merged = cc.merge(left.context, right.context, allocator);
assertEquals(headerSizeLength + 5 * headerEltLength + 5 * stepLength, merged.remaining());