@Theory
  public void computeWithMacVerifyWithChunkedMac_works(@FromDataPoints("keys") Key key)
      throws GeneralSecurityException {
    byte[] plaintext = "plaintext".getBytes(UTF_8);
    KeysetHandle.Builder.Entry entry = KeysetHandle.importKey(key);
    if (key.getIdRequirementOrNull() == null) {
      entry.withFixedId(1234);
    }
    KeysetHandle keysetHandle = KeysetHandle.newBuilder().addEntry(entry.makePrimary()).build();

    Mac mac = keysetHandle.getPrimitive(Mac.class);
    byte[] tag = mac.computeMac(plaintext);
    ChunkedMac chunkedMac = keysetHandle.getPrimitive(ChunkedMac.class);
    ChunkedMacVerification chunkedMacVerification = chunkedMac.createVerification(tag);
    chunkedMacVerification.update(ByteBuffer.wrap(plaintext));

    chunkedMacVerification.verifyMac();
  }
These tests ensure interoperability between the new ChunkedMac implementations and the old Mac
implementations.
java_src/src/test/java/com/google/crypto/tink/mac/ChunkedMacTest.java