I was wonder if I will experience race conditions or concurrency issues with this piece of code:
public User getByName(String name) {
characters.values().stream().filter(chr -> chr.getName().equalsIgnoreCase(name)).findAny().orElse(null));
}
Where `characters is:
private final Map<Integer, Player> characters = new HashMap<>();
Is there a need to use ReentrantReadWriteLock here? Basically this is a type of character storage for my game, where I add and remove the character object. (Via Put/remove).