@Test
  public void getPrimitive_wrongHash_throws() throws Exception {
    HmacPrfParams params = HmacPrfParams.newBuilder().setHashValue(13).build();
    HmacPrfKey key =
        HmacPrfKey.newBuilder()
            .setKeyValue(
                ByteString.copyFrom(
                    Hex.decode("abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd")))
            .setParams(params)
            .setVersion(0)
            .build();
    KeyData keyData =
        KeyData.newBuilder()
            .setKeyMaterialType(KeyMaterialType.SYMMETRIC)
            .setTypeUrl(TYPE_URL)
            .setValue(key.toByteString())
            .build();

    assertThrows(GeneralSecurityException.class, () -> Registry.getPrimitive(keyData, Prf.class));
  }
Type url that this manager supports.
java_src/src/test/java/com/google/crypto/tink/prf/internal/LegacyHmacPrfTestKeyManagerTest.java