do {
clock = _randClockFactory.next();
} while(batch.put(new SimpleEvent<String>("Event." + clock, clock)));
batch.setCompletionTime(System.currentTimeMillis());
EventBatchHeader header = batch.getHeader();
SimpleEventBatchSerializer<String> batchSerializer =
new SimpleEventBatchSerializer<String>(new StringSerializer(), new ClockSerializer());
byte[] bytes = batchSerializer.serialize(batch);
EventBatch<String> batch2 = batchSerializer.deserialize(bytes);
EventBatchHeader header2 = batch2.getHeader();
assertEquals(header.getVersion(), header2.getVersion());
assertEquals(header.getSize(), header2.getSize());
assertEquals(header.getOrigin(), header2.getOrigin());
assertEquals(header.getCreationTime(), header2.getCreationTime());
assertEquals(header.getCompletionTime(), header2.getCompletionTime());
assertTrue(header.getMinClock().compareTo(header2.getMinClock()) == Occurred.EQUICONCURRENTLY);
assertTrue(header.getMaxClock().compareTo(header2.getMaxClock()) == Occurred.EQUICONCURRENTLY);
}