final byte[] key = (type + "." + firstEvent.getAggregateIdentifier()).getBytes(IOUtils.UTF8);
jedis.watch(key);
Long eventCount = jedis.llen(key);
if ((firstEvent.getSequenceNumber() != 0 && eventCount == null)
|| firstEvent.getSequenceNumber() != eventCount) {
jedis.unwatch();
throw new ConcurrencyException(
String.format("Concurrent modification detected for Aggregate identifier [%s], sequence: [%s]",
firstEvent.getAggregateIdentifier(),
firstEvent.getSequenceNumber()));
}