/* in statement b==20, b will be unboxed to byte or 20 will be boxed to Byte */
Definitely primitive is not going to be boxed before comparison. b will be unboxed before comparison. It is the only way keep this rule OK. == comparison results true if one wrapper and another primitive comprises same value. And this comparison is done after unboxing the wrapper. This will always result true.