### Question:
OMDirectoryCreateResponse extends OMClientResponse { @Override protected void addToDBBatch(OMMetadataManager omMetadataManager, BatchOperation batchOperation) throws IOException { if (Result.SUCCESS == result) { for (OmKeyInfo parentKeyInfo : parentKeyInfos) { String parentKey = omMetadataManager .getOzoneDirKey(parentKeyInfo.getVolumeName(), parentKeyInfo.getBucketName(), parentKeyInfo.getKeyName()); LOG.debug("putWithBatch parent : key {} info : {}", parentKey, parentKeyInfo); omMetadataManager.getKeyTable() .putWithBatch(batchOperation, parentKey, parentKeyInfo); } String dirKey = omMetadataManager.getOzoneKey(dirKeyInfo.getVolumeName(), dirKeyInfo.getBucketName(), dirKeyInfo.getKeyName()); omMetadataManager.getKeyTable().putWithBatch(batchOperation, dirKey, dirKeyInfo); } else if (Result.DIRECTORY_ALREADY_EXISTS == result) { LOG.debug("Directory already exists. addToDBBatch is a no-op"); } } OMDirectoryCreateResponse(@Nonnull OMResponse omResponse,
      @Nonnull OmKeyInfo dirKeyInfo,
      @Nonnull List<OmKeyInfo> parentKeyInfos, @Nonnull Result result);  OMDirectoryCreateResponse(@Nonnull OMResponse omResponse,
      @Nonnull Result result);  static final Logger LOG; }### Answer:
@Test public void testAddToDBBatch() throws Exception { String volumeName = UUID.randomUUID().toString(); String keyName = UUID.randomUUID().toString(); String bucketName = UUID.randomUUID().toString(); OmKeyInfo omKeyInfo = TestOMRequestUtils.createOmKeyInfo(volumeName, bucketName, OzoneFSUtils.addTrailingSlashIfNeeded(keyName), HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.ONE); OMResponse omResponse = OMResponse.newBuilder().setCreateDirectoryResponse( OzoneManagerProtocolProtos.CreateDirectoryResponse.getDefaultInstance()) .setStatus(OzoneManagerProtocolProtos.Status.OK) .setCmdType(OzoneManagerProtocolProtos.Type.CreateDirectory) .build(); OMDirectoryCreateResponse omDirectoryCreateResponse = new OMDirectoryCreateResponse(omResponse, omKeyInfo, new ArrayList<>(), Result.SUCCESS); omDirectoryCreateResponse.addToDBBatch(omMetadataManager, batchOperation); omMetadataManager.getStore().commitBatchOperation(batchOperation); Assert.assertNotNull(omMetadataManager.getKeyTable().get( omMetadataManager.getOzoneDirKey(volumeName, bucketName, keyName))); }