code: protected TemplateEngine getTemplateEngine() {
          if (cachedTemplateEngine != null) {
              return cachedTemplateEngine;
          }
          synchronized (this) {
              if (cachedTemplateEngine != null) {
                  return cachedTemplateEngine;
              }
              cachedTemplateEngine = createTemplateEngine();
          }
          return cachedTemplateEngine;
      }
docs: ===============