@Test
  public void testInitUnsupportedModes() throws Exception {
    HpkeContextSender sender = HpkeContextSender.getInstance(DEFAULT_SUITE_NAME);
    byte[] psk = "Shhh! Secret!".getBytes(StandardCharsets.UTF_8);
    byte[] pskId = "id".getBytes(StandardCharsets.UTF_8);

    assertThrows(UnsupportedOperationException.class, () ->
        sender.init(DEFAULT_PK, DEFAULT_INFO, DEFAULT_SK));
    assertThrows(UnsupportedOperationException.class, () ->
        sender.init(DEFAULT_PK, DEFAULT_INFO, psk, pskId));
    assertThrows(UnsupportedOperationException.class, () ->
        sender.init(DEFAULT_PK, DEFAULT_INFO, DEFAULT_SK, psk, pskId));
  }
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