### Question:
KvUtils { public static PutRequest.Builder newPutRequest(ByteBuf key, ByteBuf value, PutOption<ByteBuf> option) { return PutRequest.newBuilder() .setKey(UnsafeByteOperations.unsafeWrap(key.nioBuffer())) .setValue(UnsafeByteOperations.unsafeWrap(value.nioBuffer())) .setPrevKv(option.prevKv()); } private  KvUtils(); static ByteString toProtoKey(ByteBuf key); static org.apache.bookkeeper.api.kv.result.KeyValue<ByteBuf, ByteBuf> fromProtoKeyValue(
        KeyValue kv,
        KeyValueFactory<ByteBuf, ByteBuf> kvFactory); static List<org.apache.bookkeeper.api.kv.result.KeyValue<ByteBuf, ByteBuf>> fromProtoKeyValues(
        List<KeyValue> kvs, KeyValueFactory<ByteBuf, ByteBuf> kvFactory); static RangeRequest.Builder newRangeRequest(ByteBuf key, RangeOption<ByteBuf> option); static RangeResult<ByteBuf, ByteBuf> newRangeResult(
        RangeResponse response,
        ResultFactory<ByteBuf, ByteBuf> resultFactory,
        KeyValueFactory<ByteBuf, ByteBuf> kvFactory); static PutRequest.Builder newPutRequest(ByteBuf key,
                                                   ByteBuf value,
                                                   PutOption<ByteBuf> option); static PutResult<ByteBuf, ByteBuf> newPutResult(
        PutResponse response,
        ResultFactory<ByteBuf, ByteBuf> resultFactory,
        KeyValueFactory<ByteBuf, ByteBuf> kvFactory); static IncrementRequest.Builder newIncrementRequest(ByteBuf key,
                                                               long amount,
                                                               IncrementOption<ByteBuf> option); static IncrementResult<ByteBuf, ByteBuf> newIncrementResult(
        IncrementResponse response,
        ResultFactory<ByteBuf, ByteBuf> resultFactory,
        KeyValueFactory<ByteBuf, ByteBuf> kvFactory); static DeleteRangeRequest.Builder newDeleteRequest(ByteBuf key, DeleteOption<ByteBuf> option); static DeleteResult<ByteBuf, ByteBuf> newDeleteResult(
        DeleteRangeResponse response,
        ResultFactory<ByteBuf, ByteBuf> resultFactory,
        KeyValueFactory<ByteBuf, ByteBuf> kvFactory); static CompareTarget toProtoTarget(org.apache.bookkeeper.api.kv.op.CompareTarget target); static CompareResult toProtoResult(org.apache.bookkeeper.api.kv.op.CompareResult result); static Compare.Builder toProtoCompare(CompareOp<ByteBuf, ByteBuf> cmp); static PutRequest.Builder toProtoPutRequest(PutOp<ByteBuf, ByteBuf> op); static DeleteRangeRequest.Builder toProtoDeleteRequest(DeleteOp<ByteBuf, ByteBuf> op); static RangeRequest.Builder toProtoRangeRequest(RangeOp<ByteBuf, ByteBuf> op); static RequestOp.Builder toProtoRequest(Op<ByteBuf, ByteBuf> op); static TxnResult<ByteBuf, ByteBuf> newKvTxnResult(
        TxnResponse txnResponse,
        ResultFactory<ByteBuf, ByteBuf> resultFactory,
        KeyValueFactory<ByteBuf, ByteBuf> kvFactory);  }### Answer:
@Test public void testNewPutRequest() { try (PutOption<ByteBuf> option = Options.putAndGet()) { PutRequest rr = newPutRequest(key, value, option).build(); assertEquals(keyBs, rr.getKey()); assertEquals(valueBs, rr.getValue()); assertTrue(rr.getPrevKv()); assertFalse(rr.hasHeader()); } }