private static void doHkdfKeyManagerRegistrationWithFailingPrf() throws Exception {
    HkdfPrfProtoSerialization.register();
    MutablePrimitiveRegistry.globalInstance()
        .registerPrimitiveConstructor(
            PrimitiveConstructor.create(AlwaysFailingPrf::new, HkdfPrfKey.class, Prf.class));
    MutableKeyCreationRegistry.globalInstance()
        .add(HkdfPrfKeyManager.KEY_CREATOR, HkdfPrfParameters.class);
    Registry.registerKeyManager(
        LegacyKeyManagerImpl.create(
            HkdfPrfKeyManager.getKeyType(),
            Prf.class,
            KeyMaterialType.SYMMETRIC,
            com.google.crypto.tink.proto.HkdfPrfKey.parser()),
        true);
  }
Perform registrations such as HkdfKeyManager.register, but with a failing PRF
java_src/src/test/java/com/google/crypto/tink/prf/PrfSetWrapperTest.java