@Test
    public void getAndPutTest() {
        final byte[] key = makeKey("put_test");
        TestClosure closure = new TestClosure();
        this.kvStore.get(key, closure);
        byte[] value = (byte[]) closure.getData();
        assertNull(value);

        value = makeValue("put_test_value");
        KVStoreClosure kvStoreClosure = new BaseKVStoreClosure() {
            @Override
            public void run(Status status) {
                assertEquals(status, Status.OK());
            }
        };
        this.kvStore.getAndPut(key, value, kvStoreClosure);
        assertNull(kvStoreClosure.getData());

        byte[] newVal = makeValue("put_test_value_new");
        this.kvStore.getAndPut(key, newVal, kvStoreClosure);
        assertArrayEquals(value, (byte[]) kvStoreClosure.getData());
    }
Test method: {@link RocksRawKVStore#getAndPut(byte[], byte[], KVStoreClosure)}
jraft-rheakv/rheakv-core/src/test/java/com/alipay/sofa/jraft/rhea/storage/rocksdb/RocksKVStoreTest.java