@Override
  public boolean equals(Object o) {
    if (!(o instanceof LegacyProtoParameters)) {
      return false;
    }
    ProtoParametersSerialization other = ((LegacyProtoParameters) o).serialization;
    return serialization
            .getKeyTemplate()
            .getOutputPrefixType()
            .equals(other.getKeyTemplate().getOutputPrefixType())
        && serialization.getKeyTemplate().getTypeUrl().equals(other.getKeyTemplate().getTypeUrl())
        && serialization.getKeyTemplate().getValue().equals(other.getKeyTemplate().getValue());
  }
returns the serialization which was used to create this object.
java_src/src/main/java/com/google/crypto/tink/internal/LegacyProtoParameters.java