@Test
    public void batchCompareAndPutTest() {
        final KVStateOutputList kvStates = KVStateOutputList.newInstance();
        final int batchWriteSize = RocksRawKVStore.MAX_BATCH_WRITE_SIZE + 1;
        for (int i = 1; i <= batchWriteSize; i++) {
            final byte[] key = makeKey("put_test" + i);
            final byte[] value = makeValue("put_test_value" + i);
            kvStates.add(KVState.of(KVOperation.createPut(key, value), null));
        }
        this.kvStore.batchPut(kvStates);
        kvStates.clear();

        for (int i = 1; i <= batchWriteSize; i++) {
            final byte[] key = makeKey("put_test" + i);
            final byte[] value = makeValue("put_test_value" + i);
            final byte[] update = makeValue("put_test_update" + i);
            KVStoreClosure kvStoreClosure = new BaseKVStoreClosure() {
                @Override
                public void run(Status status) {
                    assertEquals(status, Status.OK());
                }
            };
            kvStates.add(KVState.of(KVOperation.createCompareAndPut(key, update, value), kvStoreClosure));
        }
        this.kvStore.batchCompareAndPut(kvStates);
        kvStates.forEach(kvState -> assertEquals(kvState.getDone().getData(), Boolean.FALSE));
        kvStates.clear();

        for (int i = 1; i <= batchWriteSize; i++) {
            final byte[] key = makeKey("put_test" + i);
            final byte[] value = makeValue("put_test_value" + i);
            final byte[] update = makeValue("put_test_update" + i);
            KVStoreClosure kvStoreClosure = new BaseKVStoreClosure() {
                @Override
                public void run(Status status) {
                    assertEquals(status, Status.OK());
                }
            };
            kvStates.add(KVState.of(KVOperation.createCompareAndPut(key, value, update), kvStoreClosure));
        }
        this.kvStore.batchCompareAndPut(kvStates);
        kvStates.forEach(kvState -> assertEquals(kvState.getDone().getData(), Boolean.TRUE));
    }
Test method: {@link RocksRawKVStore#batchCompareAndPut(KVStateOutputList)}
jraft-rheakv/rheakv-core/src/test/java/com/alipay/sofa/jraft/rhea/storage/rocksdb/RocksKVStoreTest.java