implement and test equality comparison