code: public Rule invokableCopy(FunctionRegistry functionRegistry) {
          final Builder builder = toBuilder();
          final Class<? extends GeneratedRule> ruleClass = generatedRuleClass();
          if (ruleClass != null) {
              try {
                  //noinspection unchecked
                  final Set<Constructor> constructors = ReflectionUtils.getConstructors(ruleClass);
                  final Constructor onlyElement = Iterables.getOnlyElement(constructors);
                  final GeneratedRule instance = (GeneratedRule) onlyElement.newInstance(functionRegistry);
                  builder.generatedRule(instance);
              } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
                  LOG.warn("Unable to generate code for rule {}: {}", id(), e);
              }
          }
          return builder.build();
      }
docs: Creates a copy of this Rule with a new instance of the generated rule class if present.
  
  This prevents sharing instances across threads, which is not supported for performance reasons.
  Otherwise the generated code would need to be thread safe, adding to the runtime overhead.
  Instead we buy speed by spending more memory.
  
  @param functionRegistry the registered functions of the system
  @return a copy of this rule with a new instance of its generated code