@Test
    public void sealOpen() throws Exception {
        final HpkeContextSender ctxSender1 = createDefaultHpkeContextSender();
        assertForeign(ctxSender1);
        final byte[] enc1 = ctxSender1.getEncapsulated();
        final byte[] ciphertext1 = ctxSender1.seal(DEFAULT_PT, /* aad= */ null);

        final HpkeContextSender ctxSender2 = createDefaultHpkeContextSender();
        assertForeign(ctxSender2);
        final byte[] enc2 = ctxSender2.getEncapsulated();
        final byte[] ciphertext2 = ctxSender2.seal(DEFAULT_PT, /* aad= */ null);

        assertNotNull(enc1);
        assertNotNull(ciphertext1);
        assertNotNull(enc2);
        assertNotNull(ciphertext2);
        assertNotEquals(encodeHex(enc1), encodeHex(enc2));
        assertNotEquals(encodeHex(DEFAULT_PT), encodeHex(ciphertext1));
        assertNotEquals(encodeHex(ciphertext1), encodeHex(ciphertext2));

        final HpkeContextRecipient ctxRecipient1 = createDefaultHpkeContextRecipient(enc1);
        assertForeign(ctxRecipient1);
        byte[] plaintext1 = ctxRecipient1.open(ciphertext1, /* aad= */ null);

        final HpkeContextRecipient ctxRecipient2 = createDefaultHpkeContextRecipient(enc2);
        assertForeign(ctxRecipient2);
        byte[] plaintext2 = ctxRecipient2.open(ciphertext2, /* aad= */ null);

        assertNotNull(plaintext1);
        assertNotNull(plaintext2);
        assertArrayEquals(DEFAULT_PT, plaintext1);
        assertArrayEquals(DEFAULT_PT, plaintext2);
    }
Tests for DuckTypedHpkeSpiTest. Essentially the same as the tests for HpkeContext but
with a "foreign" HPKE Provider inserted ahead of Conscrypt. That is, one which returns
SPI instances with all the correct methods but which don't inherit directly from "our"
HpkeSpi.
common/src/test/java/org/conscrypt/DuckTypedHpkeSpiTest.java