@Test
  public void testParseWithSpaceTypeUrl_throws() throws Exception {
    KeyTemplate template =
        KeyTemplate.newBuilder()
            .setValue(ByteString.EMPTY)
            .setOutputPrefixType(OutputPrefixType.TINK)
            .setTypeUrl("SomeTypeUrlWhichHas OneSpace")
            .build();
    assertThrows(
        GeneralSecurityException.class,
        () -> TinkProtoParametersFormat.parse(template.toByteArray()));
  }
When serializing a legacy object, we always succeed, even if an object is registered.
java_src/src/test/java/com/google/crypto/tink/TinkProtoParametersFormatTest.java