I believe this was a suggestion of @dwightguth: if computeHash() returns 0, set the hashCode to 1.