Java Equals and HashCode by Reflection

Writing proper ”equals()” and ”hashCode()” methods A class which is to be used in Maps and Sets must always have their equals() and hashCode() method overridden so that they reflect the data structure of the actual object. This means that the fields of the object which are required for equality must be taken into account […]