Yes, boxed() uses Integer.valueOf which can retrieve some Integer instances from a cache.
So you should either use the version with boxed() (preferably), or use Integer.valueOf instead of new Integer(). Note that boxed() is in fact shorthand for mapToObj(Integer::valueOf).