code: @EnsuresNonNull("predicateFactory")
    private JavaScriptPredicateFactory getPredicateFactory()
    {
      // JavaScript configuration should be checked when it's actually used because someone might still want Druid
      // nodes to be able to deserialize JavaScript-based objects even though JavaScript is disabled.
      Preconditions.checkState(config.isEnabled(), "JavaScript is disabled");
  
      JavaScriptPredicateFactory syncedFnPredicateFactory = predicateFactory;
      if (syncedFnPredicateFactory == null) {
        synchronized (config) {
          syncedFnPredicateFactory = predicateFactory;
          if (syncedFnPredicateFactory == null) {
            syncedFnPredicateFactory = new JavaScriptPredicateFactory(function, extractionFn);
            predicateFactory = syncedFnPredicateFactory;
          }
        }
      }
      return syncedFnPredicateFactory;
    }
docs: This class can be used by multiple threads, so this function should be thread-safe to avoid extra
  script compilation.