Returns a synchronized wrapper backed by this map. This is the equivalent of calling
Collections.synchronizedMap(this) only with the more feature rich return type of
MutableMapIterable.
The preferred way of iterating over a synchronized map is to use the forEachKey(), forEachValue()
and forEachKeyValue() methods which are properly synchronized internally.
MutableMap synchedMap = map.asSynchronized();
synchedMap.forEachKey(key -> ... );
synchedMap.forEachValue(value -> ... );
synchedMap.forEachKeyValue((key, value) -> ... );
If you want to iterate imperatively over the keySet(), values(), or entrySet(), you will
need to protect the iteration by wrapping the code in a synchronized block on the map.