### Question:
OMVolumeDeleteResponse extends OMClientResponse { @Override protected void addToDBBatch(OMMetadataManager omMetadataManager, BatchOperation batchOperation) throws IOException { String dbUserKey = omMetadataManager.getUserKey(owner); UserVolumeInfo volumeList = updatedVolumeList; if (updatedVolumeList.getVolumeNamesList().size() == 0) { omMetadataManager.getUserTable().deleteWithBatch(batchOperation, dbUserKey); } else { omMetadataManager.getUserTable().putWithBatch(batchOperation, dbUserKey, volumeList); } omMetadataManager.getVolumeTable().deleteWithBatch(batchOperation, omMetadataManager.getVolumeKey(volume)); } OMVolumeDeleteResponse(@Nonnull OMResponse omResponse,
      @Nonnull String volume, @Nonnull String owner,
      @Nonnull UserVolumeInfo updatedVolumeList);  OMVolumeDeleteResponse(@Nonnull OMResponse omResponse);   }### Answer:
@Test public void testAddToDBBatch() throws Exception { String volumeName = UUID.randomUUID().toString(); String userName = "user1"; UserVolumeInfo volumeList = UserVolumeInfo.newBuilder() .setObjectID(1) .setUpdateID(1) .addVolumeNames(volumeName).build(); OMResponse omResponse = OMResponse.newBuilder() .setCmdType(OzoneManagerProtocolProtos.Type.DeleteVolume) .setStatus(OzoneManagerProtocolProtos.Status.OK) .setSuccess(true) .setCreateVolumeResponse(CreateVolumeResponse.getDefaultInstance()) .build(); OmVolumeArgs omVolumeArgs = OmVolumeArgs.newBuilder() .setOwnerName(userName).setAdminName(userName) .setVolume(volumeName).setCreationTime(Time.now()).build(); OMVolumeCreateResponse omVolumeCreateResponse = new OMVolumeCreateResponse(omResponse, omVolumeArgs, volumeList); UserVolumeInfo updatedVolumeList = UserVolumeInfo.newBuilder() .setObjectID(1).setUpdateID(1).build(); OMVolumeDeleteResponse omVolumeDeleteResponse = new OMVolumeDeleteResponse(omResponse, volumeName, userName, updatedVolumeList); omVolumeCreateResponse.addToDBBatch(omMetadataManager, batchOperation); omVolumeDeleteResponse.addToDBBatch(omMetadataManager, batchOperation); omMetadataManager.getStore().commitBatchOperation(batchOperation); Assert.assertNull(null, omMetadataManager.getVolumeTable().get( omMetadataManager.getVolumeKey(volumeName))); Assert.assertEquals(null, omMetadataManager.getUserTable().get( omMetadataManager.getUserKey(userName))); }