private static HkdfPrfParameters[] createRejectedParameters() {
    return exceptionIsBug(
        () ->
            new HkdfPrfParameters[] {
              // Key Size 16 is rejected
              HkdfPrfParameters.builder()
                  .setHashType(HkdfPrfParameters.HashType.SHA512)
                  .setKeySizeBytes(16)
                  .build(),
              // Only SHA256 and SHA512 are accepted
              HkdfPrfParameters.builder()
                  .setHashType(HkdfPrfParameters.HashType.SHA1)
                  .setKeySizeBytes(32)
                  .build(),
              HkdfPrfParameters.builder()
                  .setHashType(HkdfPrfParameters.HashType.SHA224)
                  .setKeySizeBytes(32)
                  .build(),
              HkdfPrfParameters.builder()
                  .setHashType(HkdfPrfParameters.HashType.SHA384)
                  .setKeySizeBytes(32)
                  .build()
            });
  }
We allow serialization and deserialization with parameters which are otherwise rejected
java_src/src/test/java/com/google/crypto/tink/prf/HkdfPrfKeyManagerTest.java