@Test
  public void encrypt_failsWithNullPlaintext() throws GeneralSecurityException {
    HpkePublicKey recipientPublicKey = getPublicKey(getDefaultValidParams());
    HybridEncrypt hpkeEncrypt = HpkeEncrypt.create(recipientPublicKey);

    byte[] contextInfo = Random.randBytes(100);
    byte[] nullPlaintext = null;

    assertThrows(
        NullPointerException.class, () -> hpkeEncrypt.encrypt(nullPlaintext, contextInfo));
  }
Unit tests for {@link HpkeEncrypt} and {@link HpkeDecrypt}.
java_src/src/test/java/com/google/crypto/tink/hybrid/internal/HpkeEncryptDecryptTest.java