If a @PreUpdate listener is present, a ClassCastException is raised during flush after an update of an association defined to use collection (bag) semantics when the assigned value is a set.
If the listener is removed from the equation the test passes?
The test passes if @PreUpdate is commented out in the listener or if the entity listener is not listed in the entity class.
Fixed in master; it will be fixed in 5.3 branch soon.
Fixed in 5.3 branch as well.