private void testBasicMultipleEncrypts(EciesParameters.CurveType curveType, Parameters parameters)
      throws Exception {
    KeyPair recipientKey = EllipticCurves.generateKeyPair(toParameterSpec(curveType));
    ECPublicKey recipientPublicKey = (ECPublicKey) recipientKey.getPublic();
    ECPrivateKey recipientPrivateKey = (ECPrivateKey) recipientKey.getPrivate();
    byte[] salt = "some salt".getBytes("UTF-8");
    byte[] plaintext = Random.randBytes(20);
    byte[] context = "context info".getBytes("UTF-8");
    EciesParameters eciesParameters =
        EciesParameters.builder()
            .setCurveType(curveType)
            .setHashType(EciesParameters.HashType.SHA256)
            .setNistCurvePointFormat(EciesParameters.PointFormat.UNCOMPRESSED)
            .setVariant(EciesParameters.Variant.NO_PREFIX)
            .setDemParameters(parameters)
            .setSalt(Bytes.copyFrom(salt))
            .build();
    EciesPublicKey eciesPublicKey =
        EciesPublicKey.createForNistCurve(
            eciesParameters, recipientPublicKey.getW(), /* idRequirement= */ null);
    EciesPrivateKey eciesPrivateKey =
        EciesPrivateKey.createForNistCurve(
            eciesPublicKey,
            SecretBigInteger.fromBigInteger(
                recipientPrivateKey.getS(), InsecureSecretKeyAccess.get()));

    HybridEncrypt hybridEncrypt = EciesAeadHkdfHybridEncrypt.create(eciesPublicKey);
    HybridDecrypt hybridDecrypt = EciesAeadHkdfHybridDecrypt.create(eciesPrivateKey);

    // Makes sure that the encryption is randomized.
    Set<String> ciphertexts = new TreeSet<String>();
    for (int j = 0; j < 8; j++) {
      byte[] ciphertext = hybridEncrypt.encrypt(plaintext, context);
      if (ciphertexts.contains(new String(ciphertext, "UTF-8"))) {
        throw new GeneralSecurityException("Encryption is not randomized");
      }
      ciphertexts.add(new String(ciphertext, "UTF-8"));
      byte[] decrypted = hybridDecrypt.decrypt(ciphertext, context);
      assertArrayEquals(plaintext, decrypted);
    }
    assertEquals(8, ciphertexts.size());
  }
Unit tests for EciesAeadHkdfHybridEncrypt.

<p>TODO(b/74250701): Add more tests.
java_src/src/test/java/com/google/crypto/tink/hybrid/EciesAeadHkdfHybridEncryptTest.java