You shouldn't be using hashcode's for equality checking, see http://stackoverflow.com/questions/9946671/java-hashcode-strings-collision