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
As others have already said, you will need to implement (override) equals(), hashCode() and (prefarably) compareTo() from Comparable interface. These methods, if not implemented correctly can lead to unexpected runtime behavior. Hard to debug issues. Hence, I suggest you use Apache Commons EqualsBuilder, HashcodeBuilder and ComparableBuilder to implement these methods. An example of how to use Apache Commons builder can be seen in this link http://www.javaworld.com/community/node/1859