While Integer is immutable, AtomicInteger is mutable (and is mostly used as mutable instance).
This check fails (only in test) because we expect that Infinispan will provide optimized marshallers for java.util types, and AtomicInteger isn't one of them. And for good: if you have to marshall the instance, the modifications won't be applied to the unmarshalled copy.
I write a mechanism of execution task will detect the change and apply the changes based on transaction.
But since the Integer is immutable. I can't detect the change.
So I want to use AtomicInteger as a replacement. But it's not available to use in test cases.
But now, I have to wrap a int in a class myself.