### Question:
TableStoreUtils { static KeyValue newKeyValue(ByteString rKey, org.apache.bookkeeper.api.kv.result.KeyValue<byte[], byte[]> kv) { if (null == kv) { return null; } return KeyValue.newBuilder() .setKey(getLKey(kv.key(), rKey)) .setValue(UnsafeByteOperations.unsafeWrap(kv.value())) .setCreateRevision(kv.createRevision()) .setModRevision(kv.modifiedRevision()) .setVersion(kv.version()) .setIsNumber(kv.isNumber()) .setNumberValue(kv.numberValue()) .build(); }    }### Answer:
@SuppressWarnings("unchecked") @Test public void testNewKeyValue() { long rid = System.currentTimeMillis(); long createRev = 2 * System.currentTimeMillis(); long modRev = 3 * System.currentTimeMillis(); long version = 4 * System.currentTimeMillis(); KeyValue<byte[], byte[]> kv = mock(KeyValue.class); when(kv.key()).thenReturn(storeKeyWithRKey); when(kv.value()).thenReturn(this.value); when(kv.createRevision()).thenReturn(createRev); when(kv.modifiedRevision()).thenReturn(modRev); when(kv.version()).thenReturn(version); org.apache.bookkeeper.stream.proto.kv.KeyValue keyValue = newKeyValue(ByteString.copyFrom(rKey), kv); assertEquals(ByteString.copyFrom(lKey), keyValue.getKey()); assertEquals(ByteString.copyFrom(value), keyValue.getValue()); assertEquals(createRev, keyValue.getCreateRevision()); assertEquals(modRev, keyValue.getModRevision()); assertEquals(version, keyValue.getVersion()); }