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

    Mac mac = MacFactory.getPrimitive(handle);

    byte[] data = "data".getBytes(UTF_8);
    byte[] tag = mac.computeMac(data);
    mac.verifyMac(tag, data);
  }
Unit test for {@link MacFactory}.

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