Notice
I wrote this article and was originally published on Qiita on 31 August 2021.
In past I don't understand why code in inner block doesn't run.
if (new Integer(1) == new Integer(1)) {
doImportantJob();
};
Since "==" operator for object means if both objects point to the same memory location. The code above means two Integer(1) object is created, of course two sides must point to different memory location.