@Test
  @SuppressWarnings("deprecation") // This is a test that the deprecated function works.
  public void deprecatedFactoryGetPrimitive_whenWrapperHasNotBeenRegistered_works()
      throws Exception {
    // Only register AesCtrHmacAeadKeyManager, but not the AeadWrapper.
    AesCtrHmacAeadKeyManager.register(/*newKeyAllowed=*/ true);
    KeysetHandle handle = KeysetHandle.generateNew(KeyTemplates.get("AES128_CTR_HMAC_SHA256"));

    Aead aead = AeadFactory.getPrimitive(handle);

    byte[] plaintext = "plaintext".getBytes(UTF_8);
    byte[] associatedData = "associatedData".getBytes(UTF_8);
    byte[] ciphertext = aead.encrypt(plaintext, associatedData);
    assertThat(aead.decrypt(ciphertext, associatedData)).isEqualTo(plaintext);
  }
Unit test for {@link AeadFactory}.

<p>The test case in this file needs {@link Registry} to not have AeadWrapper registered. That's
why it is in its own test file.
java_src/src/test/java/com/google/crypto/tink/aead/AeadFactoryWithoutWrapperRegisteredTest.java