Tim -- yes, that looks better. The hashCode() method could be simplified, though:
Also, a better test would be:
There is much more to equals() and hashCode(). The best reference on this subject (and many others) is
Effective Java [ May 21, 2004: Message edited by: Eugene Kononov ]