Integer == Integer actually works... sometimes, as long as you're within the Integer cache. It gets people all the time though.
Yep. I’ve been bitten by that myself. It’s sneaky because it may pass all your unit tests because you’re using small numbers. Then it gets to prod with record number 2718 and kablooie.
The tricky one is numbers.
Integer == int // fine
int == int // fine
numVarOne == numVarTwo // Uh-oh
In that third example you better make sure they aren’t both boxed objects or BigDecimals.
I’ve almost never seen the string one for some reason. It’s always boxed numbers.
Again, a good IDE is worth a ton.