One way to be more confident that the map is not modified during the"read-only" phase is to divide the application into two phases withtwo different maps: First populate the map with a thread-safe implementationlike
m = Collections.synchronizedMap(new HashMap());
then make an immutable copy using
m2 = Collections.unmodifiableMap(new HashMap(m));