Protobuf generates code for equals() and hashcode() which compares all fields. This is not needed, or even incorrect: for example, name in Address is not needed and can even be empty.
Implement equals() and hashcode() for Address. They can then be used as Comparator for hashmaps/sets etc.
Protobuf generates code for
equals()andhashcode()which compares all fields. This is not needed, or even incorrect: for example,nameinAddressis not needed and can even be empty.Implement
equals()andhashcode()forAddress. They can then be used asComparatorfor hashmaps/sets etc.