### Question:
OMKeysRenameResponse extends OMClientResponse { @Override public void addToDBBatch(OMMetadataManager omMetadataManager, BatchOperation batchOperation) throws IOException { String volumeName = omRenameKeys.getVolume(); String bucketName = omRenameKeys.getBucket(); for (Map.Entry< String, OmKeyInfo> entry : omRenameKeys.getFromKeyAndToKeyInfo().entrySet()) { String fromKeyName = entry.getKey(); OmKeyInfo newKeyInfo = entry.getValue(); String toKeyName = newKeyInfo.getKeyName(); omMetadataManager.getKeyTable().deleteWithBatch(batchOperation, omMetadataManager .getOzoneKey(volumeName, bucketName, fromKeyName)); omMetadataManager.getKeyTable().putWithBatch(batchOperation, omMetadataManager.getOzoneKey(volumeName, bucketName, toKeyName), newKeyInfo); } } OMKeysRenameResponse(@Nonnull OMResponse omResponse,
                              OmRenameKeys omRenameKeys);  OMKeysRenameResponse(@Nonnull OMResponse omResponse); @Override void addToDBBatch(OMMetadataManager omMetadataManager,
                           BatchOperation batchOperation);  }### Answer:
@Test public void testKeysRenameResponse() throws Exception { createPreRequisities(); OMResponse omResponse = OMResponse.newBuilder() .setRenameKeysResponse(RenameKeysResponse.getDefaultInstance()) .setStatus(Status.OK).setCmdType(Type.RenameKeys).build(); OMKeysRenameResponse omKeysRenameResponse = new OMKeysRenameResponse( omResponse, omRenameKeys); omKeysRenameResponse.addToDBBatch(omMetadataManager, batchOperation); omMetadataManager.getStore().commitBatchOperation(batchOperation); TestOMRequestUtils.addVolumeAndBucketToDB(volumeName, bucketName, omMetadataManager); for (int i = 0; i < count; i++) { String key = parentDir.concat("/key" + i); String toKey = parentDir.concat("/newKey" + i); key = omMetadataManager.getOzoneKey(volumeName, bucketName, key); toKey = omMetadataManager.getOzoneKey(volumeName, bucketName, toKey); Assert.assertFalse(omMetadataManager.getKeyTable().isExist(key)); Assert.assertTrue(omMetadataManager.getKeyTable().isExist(toKey)); } }