Is there a way in which we can equate two objects?
I know that we can use equals, but the problem is that I need to write a utility which can compare any two objects implementing same interface.
Now the object can have 1 attribute, or 2 attribute or can have 100 attribute. and i need to compare each and every attribute to prove then exactly equal.
You may have a look at the Apache Commons helper classes EqualsBuilder and HashCodeBuilder. These classes provides methods to build good
equalsandhashCodemethod for any class.