I have a problem with Set as it contains two the same instances of data class, even though it should be impossible. You can see on the screen that both objects are allocated to the same place in memory.
It is filled in regular map lambda, no concurrency.
I’ve found out, that contains() function returns false, so the element is added to the Set, but when I compare both element, they are identical.
It can be fixed with this “hack” as activatedOffers is mutableSet
activatedOffers.toSet()
, but I’m curious why is it happening
I’ve prepared an example project with the exact code, but I am not able to reproduce it anywhere but my Spring app.
I know it is hard to debug this way. I am willing to do a Code With Me session to debug it.