@Test
  public void checkSerializationRegistered() throws Exception {
    PrfBasedKeyDerivationParameters params =
        PrfBasedKeyDerivationParameters.builder()
            .setPrfParameters(
                HkdfPrfParameters.builder()
                    .setKeySizeBytes(32)
                    .setHashType(HkdfPrfParameters.HashType.SHA256)
                    .build())
            .setDerivedKeyParameters(XChaCha20Poly1305Parameters.create())
            .build();

    KeysetHandle handle = KeysetHandle.generateNew(params);

    byte[] serialized =
        TinkProtoKeysetFormat.serializeKeyset(handle, InsecureSecretKeyAccess.get());
    KeysetHandle parsed =
        TinkProtoKeysetFormat.parseKeyset(serialized, InsecureSecretKeyAccess.get());

    assertTrue(parsed.equalsKeyset(handle));
  }
We test newKeyData directly because PrfBasedDeriverKeyManager has its own implementation.
java_src/src/test/java/com/google/crypto/tink/keyderivation/internal/PrfBasedDeriverKeyManagerTest.java