Yes, there may be a problem. ConcurrentHashMap will be thread safe for accessing the Map, but in lists to be executed, it should be thread safe if multiple threads can work simultaneously with instance instances.
Therefore, use a list that does not contain threads, if true.
Change - now, when I think about it, the rabbit hole goes further. You have a map, you have your own list, and you have objects in the list. Anything that can be modified by multiple threads must be thread safe. Therefore, if many streams can modify maps, lists, and objects in lists, then all of them must be protected from streams. If only Map and List instances can be changed at the same time, only they need thread safety. If several threads can read everything but not change, then you do not need thread safety (I think someone correct me if this is not so)
source share