Reimplement isEqualTo using hashElements