These examples are used in the following blog posts: The Java Memory Model enables testing of multithreaded Java Why is combining thread-safe methods an error? ConcurrentHashMap: Call only one method per key Lambdas for concurrent maps