handle null in comparison
if equals is defined, hashcode must be as well