@Test
  public void testRandomizedDataChunking() throws Exception {
    assumeFalse(TinkFips.useOnlyFips());
    for (AesCmacTestVector t : CMAC_TEST_VECTORS_FROM_RFC) {
      testRandomized(t);
    }
    for (AesCmacTestVector t : CMAC_IMPLEMENTATION_DETAIL_TEST_VECTORS) {
      testRandomized(t);
    }

    // Only feed "valid" Wycheproof test cases into the randomized test.
    JsonObject json =
        WycheproofTestUtil.readJson("../wycheproof/testvectors/aes_cmac_test.json");
    JsonArray testGroups = json.getAsJsonArray("testGroups");
    for (int i = 0; i < testGroups.size(); i++) {
      JsonObject group = testGroups.get(i).getAsJsonObject();
      JsonArray tests = group.getAsJsonArray("tests");

      int tagSize = group.get("tagSize").getAsInt();
      int keySize = group.get("keySize").getAsInt();
      if (!Arrays.asList(16, 32).contains(keySize / 8)) {
        continue;
      }

      for (int j = 0; j < tests.size(); j++) {
        JsonObject testCase = tests.get(j).getAsJsonObject();
        if (!testCase.get("result").getAsString().equals("valid")) {
          continue;
        }

        String key = testCase.get("key").getAsString();
        String msg = testCase.get("msg").getAsString();
        String tag = testCase.get("tag").getAsString();

        testRandomized(
            new AesCmacTestVector(
                AesCmacTestUtil.createAesCmacKey(
                    key,
                    AesCmacTestUtil.createAesCmacParameters(
                        keySize / 8, tagSize / 8, Variant.NO_PREFIX),
                    null),
                msg,
                tag));
      }
    }
  }
Finally, here comes a randomized test. In case, for some reason, the above tests do not catch
some bug, we'll have a chance to catch it here.
java_src/src/test/java/com/google/crypto/tink/mac/internal/ChunkedAesCmacTest.java