hashCode is inconsistent for Trade objects.
Two trade objects with same positive id will have a different hashCode, and this is having bad side effects, for example when objects are retrieved from hash maps using trades as keys. Indeed, trade objects with same positive ids will be equal, so they should also have the same hashCode to avoid such inconsistencies.
To Reproduce
Steps to reproduce the behavior:
Have a code snippet with two trade objects (A and B), having the same positive id.
Create a HashMap and add an entry with A as key and the "OK" String as value
Call get(B) on the map
Expected behavior
Calling get(B) on the map is expected to return "OK" and not null.
hashCode is inconsistent for Trade objects. Two trade objects with same positive id will have a different hashCode, and this is having bad side effects, for example when objects are retrieved from hash maps using trades as keys. Indeed, trade objects with same positive ids will be equal, so they should also have the same hashCode to avoid such inconsistencies.
To Reproduce Steps to reproduce the behavior:
Expected behavior Calling get(B) on the map is expected to return "OK" and not null.
Environment :