...
When explicitly constructed, an Integer
object has a unique reference and its own intrinsic lock that is not shared with other Integer
objects or boxed integers having the same value. While this is an acceptable solution, it may cause maintenance problems. It is always better to synchronize on a an internal private final raw Object
as described next.
...