fail("RemoveOldShards should throw an exception if the current id is non-sensical");
}
catch (RuntimeException e) {}
CounterId.renewLocalId();
ByteBuffer merger = ctx.computeOldShardMerger(state.context, Collections.<CounterId.CounterIdRecord>emptyList(), 0);
ByteBuffer cleaned = ctx.removeOldShards(ctx.merge(state.context, merger, HeapAllocator.instance), now);
assert ctx.total(cleaned) == 11;
// Check it is not corrupted anymore
ContextState state2 = new ContextState(cleaned);