The problem is caused by him comparing objects as if they were primitives. The Integer class is basically just a wrapper around an "int" primitive. When an Integer object is initialized with a value between -128 and 127 it will return an object from an internal cache.
The second time he creates an Integer with the value of 127 it uses the cached object, which of course is identical to the previous one. When he tries this with 128, the cache is not used and a new Integer object is created.
tl;dr; Integer is an object where some values are cached to avoid creating a new object. The "==" operator compares the objects, and not the values they represent.