Upated testEquality method