what is hashcode and equals in java code example Example: How to compare lists of custom classes without defining equals() and hashCode()? lists equal