static void configureEncryption(
      S3FileIOProperties s3FileIOProperties, PutObjectRequest.Builder requestBuilder) {
    configureEncryption(
        s3FileIOProperties,
        requestBuilder::serverSideEncryption,
        requestBuilder::ssekmsKeyId,
        requestBuilder::sseCustomerAlgorithm,
        requestBuilder::sseCustomerKey,
        requestBuilder::sseCustomerKeyMD5);
  }
@Test
  public void testConfigureDualLayerServerSideKmsEncryption() {
    S3FileIOProperties s3FileIOProperties = new S3FileIOProperties();
    s3FileIOProperties.setSseType(S3FileIOProperties.DSSE_TYPE_KMS);
    s3FileIOProperties.setSseKey("key");
    S3RequestUtil.configureEncryption(
        s3FileIOProperties,
        this::setServerSideEncryption,
        this::setKmsKeyId,
        this::setCustomAlgorithm,
        this::setCustomKey,
        this::setCustomMd5);
    assertThat(serverSideEncryption).isEqualTo(ServerSideEncryption.AWS_KMS_DSSE);
    assertThat(kmsKeyId).isEqualTo("key");
    assertThat(customAlgorithm).isNull();
    assertThat(customKey).isNull();
    assertThat(customMd5).isNull();
  }