@Test
public void getPrimitive_works() throws Exception {

  AesCmacKeyManager manager = new AesCmacKeyManager();
  AesCmacKey validKey = manager.keyFactory().createKey(makeAesCmacKeyFormat(32, 16));
  Mac managerMac = manager.getPrimitive(validKey, Mac.class);
  Mac directMac =
      new PrfMac(
          new PrfAesCmac(validKey.getKeyValue().toByteArray()),
          validKey.getParams().getTagSize());
  byte[] message = Random.randBytes(50);
  managerMac.verifyMac(directMac.computeMac(message), message);
}