@Theory
  public void decryptWrongContextInfo_throws(@FromDataPoints("testVectors") HybridTestVector v)
      throws Exception {
    HybridDecrypt hybridDecrypt =
        HpkeDecrypt.create((com.google.crypto.tink.hybrid.HpkePrivateKey) v.getPrivateKey());
    byte[] contextInfo = v.getContextInfo();
    if (contextInfo.length > 0) {
      contextInfo[0] ^= 1;
    } else {
      contextInfo = new byte[] {1};
    }
    // local variables referenced from a lambda expression must be final or effectively final
    final byte[] contextInfoCopy = Arrays.copyOf(contextInfo, contextInfo.length);
    assertThrows(
        GeneralSecurityException.class,
        () -> hybridDecrypt.decrypt(v.getCiphertext(), contextInfoCopy));
  }
Unit tests for {@link HpkeEncrypt} and {@link HpkeDecrypt}.
java_src/src/test/java/com/google/crypto/tink/hybrid/internal/HpkeEncryptDecryptTest.java