I\'m a bit confused about the way Java treats == and equals() when it comes to int, Integer and other types of numbers.
==
equals()
int
Integer
I remember a good practice for overriding "equal(object obj)" is of first checking the type of the parameter passed in. So perhap this causes X.equals(Y) to be false. You might check the souce code to dig out the truth :)