@Test
    public void export() throws Exception {
        final HpkeContextSender ctxSender = createDefaultHpkeContextSender();
        assertForeign(ctxSender);
        final byte[] enc = ctxSender.getEncapsulated();
        final byte[] export1 = ctxSender.export(DEFAULT_EXPORTER_LENGTH, DEFAULT_EXPORTER_CONTEXT);

        final HpkeContextRecipient ctxRecipient = createDefaultHpkeContextRecipient(DEFAULT_ENC);
        assertForeign(ctxRecipient);
        final byte[] export2 =
            ctxRecipient.export(DEFAULT_EXPORTER_LENGTH, DEFAULT_EXPORTER_CONTEXT);

        assertNotNull(enc);
        assertNotNull(export1);
        assertEquals(DEFAULT_EXPORTER_LENGTH, export1.length);
        assertNotNull(export2);
        assertEquals(DEFAULT_EXPORTER_LENGTH, export2.length);
        assertNotEquals(encodeHex(DEFAULT_ENC), encodeHex(enc));
        assertNotEquals(encodeHex(export1), encodeHex(export2));
    }
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