title: Factory method to create singleton instance
body: <p><br>
  I have written below code in static factory method to return single instance of DefaultCache.</p>
  
  <pre><code>public static ICache getInstance() {
     if (cacheInstance == null) {
        synchronized (ICache.class) {
           if (cacheInstance == null) {
              cacheInstance = new DefaultCache();
           }
        }
     }
     return cacheInstance;
  }
  </code></pre>
  
  <p>Do we really need 2nd null check for <b>cacheInstance</b> inside the synchronized block?</p>