Simplify hashCode and equals. 

Checking for pointer is enough.