I have simple question to you, I have class Product that have fields like this:
private Integer id; private String category; private String symbol; private S
I would suggest you implement your own hash function in a way that it hashes elements with equal ID-s with the same code. This will solve your issue, without you having to code it explicitly.