@Test
  public void testWithAeadPrimitive() {
    AeadOrDaead aeadOrDaead = new AeadOrDaead(new DummyAead());

    // Test that encrypt and decrypt is called on the DummyAead.
    GeneralSecurityException thrown =
        assertThrows(
            GeneralSecurityException.class,
            () -> aeadOrDaead.encrypt(TEST_BYTE_VECTOR, TEST_BYTE_VECTOR));
    assertThat(thrown).hasMessageThat().contains("dummy");

    thrown =
        assertThrows(
            GeneralSecurityException.class,
            () -> aeadOrDaead.decrypt(TEST_BYTE_VECTOR, TEST_BYTE_VECTOR));
    assertThat(thrown).hasMessageThat().contains("dummy");
  }
A dummy Deterministic Aead-implementation that just throws exception.
java_src/src/test/java/com/google/crypto/tink/hybrid/subtle/AeadOrDaeadTest.java