Correct hashcode and equals methods for hashmap using.