Implementing object equivalence in Java using the template method design pattern

@inproceedings{Stevenson2003ImplementingOE,
  title={Implementing object equivalence in Java using the template method design pattern},
  author={Daniel E. Stevenson and Andrew T. Phillips},
  booktitle={SIGCSE},
  year={2003}
}
A standard practice in object-oriented programming is to implement an operation, called equals in Java, for testing the equality of two objects. The equals method should be defined for every new Java class, but because of the intricacies of inheritance, casting, and dynamic typing, equals is often quite difficult to write correctly. And unfortunately many textbooks present flawed implementations of this operation. In this paper, we present a semantically correct technique for testing object… CONTINUE READING