title: Is this the correct and efficient way to make a singleton map thread safe in a static method
body: <p>I would like to create lock only once when map is initialized. Here is the code i am using.</p>
  
  <pre><code>public static Map&lt;String, String&gt; getOrderStatusInstance() {
      if (orderStatusMap == null) {
          synchronized (Utility.class) {
              orderStatusMap = new HashMap&lt;String, String&gt;();
  
              orderStatusMap.put("Key1", "Value1");
              orderStatusMap.put("Key2", "Value2");
              orderStatusMap.put("Key3", "Value3");
              orderStatusMap.put("Key4", "Value4");
          }
      }
  
      return orderStatusMap;
  }
  </code></pre>