refactored equals tests