@Override
  protected List<String> deleteObjects(List<String> keys) throws IOException {
    try {
      DeleteObjectsRequest request = new DeleteObjectsRequest(mBucketNameInternal);
      List<DeleteObjectsRequest.KeyVersion> keyVersions = keys.stream()
          .map(DeleteObjectsRequest.KeyVersion::new)
          .collect(Collectors.toList());
      request.setKeys(keyVersions);
      DeleteObjectsResult result = mClient.deleteObjects(request);
      return result.getDeletedObjects()
          .stream()
          .map(DeleteObjectsResult.DeletedObject::getKey)
          .collect(Collectors.toList());
    } catch (CosClientException e) {
      LOG.warn("failed to delete objects");
      throw AlluxioCosException.from(e);
    }
  }
@Test
  public void testDeleteObjects() throws IOException {
    String[] stringKeys = new String[]{"key1", "key2", "key3"};
    List<String> keys = new ArrayList<>();
    Collections.addAll(keys, stringKeys);
    List<DeleteObjectsResult.DeletedObject> deletedObjects =
        new ArrayList<>();
    for (String key : keys) {
      DeleteObjectsResult.DeletedObject deletedObject =
          new DeleteObjectsResult.DeletedObject();
      deletedObject.setKey(key);
      deletedObjects.add(deletedObject);
    }
    // test successful delete objects
    Mockito.when(mClient.deleteObjects(ArgumentMatchers.any(DeleteObjectsRequest.class)))
        .thenReturn(new DeleteObjectsResult(deletedObjects));

    List<String> result = mCOSUnderFileSystem.deleteObjects(keys);
    Assert.assertEquals(keys, result);

    // test delete objects exception
    Mockito.when(mClient.deleteObjects(ArgumentMatchers.any(DeleteObjectsRequest.class)))
        .thenThrow(CosClientException.class);
    try {
      mCOSUnderFileSystem.deleteObjects(keys);
    } catch (Exception e) {
      Assert.assertTrue(e instanceof AlluxioCosException);
    }
  }