public void testWriteAndDeleteBatch() throws Exception {
int numberOfEntries = 2 * ThreadLocalRandom.current().nextInt(WRITE_DELETE_BATCH_MIN_ENTRIES / 2, WRITE_DELETE_BATCH_MAX_ENTRIES / 2 + 1);
assertIsEmpty();
assertNull("should not be present in the store", cl.load(0));
List<MarshalledEntry<?, ?>> entries = IntStream.range(0, numberOfEntries).boxed()
.map(i -> marshalledEntry(i.toString(), "Val" + i, null))
.collect(Collectors.toList());
cl.writeBatch(entries);
Set<MarshalledEntry<Object, Object>> set = TestingUtil.allEntries(cl);
assertSize(set, numberOfEntries);
assertNotNull(cl.load("56"));
int batchSize = numberOfEntries / 2;
List<Object> keys = IntStream.range(0, batchSize).mapToObj(Integer::toString).collect(Collectors.toList());
cl.deleteBatch(keys);
set = TestingUtil.allEntries(cl);
assertSize(set, batchSize);
assertNull(cl.load("20"));
}