What happens when a value object reaches synchronized through an Object reference? With JDK 28 preview features enabled, only identity objects have monitors. If the reference points to a value object, monitor acquisition throws IdentityException.
Use a separate identity object when you need a lock. #Java
116251





