public static void assertEqualWhenValueParsed(
      Parser<? extends MessageLite> parser, ProtoKeySerialization one, ProtoKeySerialization two) {
    assertThat(one.getKeyMaterialType()).isEqualTo(two.getKeyMaterialType());
    assertThat(one.getOutputPrefixType()).isEqualTo(two.getOutputPrefixType());
    assertThat(one.getIdRequirementOrNull()).isEqualTo(two.getIdRequirementOrNull());
    assertThat(one.getTypeUrl()).isEqualTo(two.getTypeUrl());
    try {
      MessageLite valueOne =
          parser.parseFrom(one.getValue(), ExtensionRegistryLite.getEmptyRegistry());
      MessageLite valueTwo =
          parser.parseFrom(two.getValue(), ExtensionRegistryLite.getEmptyRegistry());
      assertThat(valueOne).isEqualTo(valueTwo);
    } catch (InvalidProtocolBufferException e) {
      throw new AssertionError("Unable to parse value with given parser", e);
    }
  }
Throws an assertion error if two {@link ProtoParametersSerialization} objects are not equal.

<p>Because ProtoSerialization is not deterministic, this requires a parser for the proto
message embedded in the {@code ProtoParametersSerialization}.

<p>Equality of the protos is decided by message equality, see {@link
com.google.protobuf.Message#equals}.
java_src/src/main/java/com/google/crypto/tink/internal/testing/Asserts.java