docs: private RootPathToken invertScannerFunctionRelationship(final RootPathToken path) {
          if (path.isFunctionPath() && path.next() instanceof ScanPathToken) {
              PathToken token = path;
              PathToken prior = null;
              while (null != (token = token.next()) && !(token instanceof FunctionPathToken)) {
                  prior = token;
              }
              // Invert the relationship $..path.function() to $.function($..path)
              if (token instanceof FunctionPathToken) {
                  prior.setNext(null);
                  path.setTail(prior);
  
                  // Now generate a new parameter from our path
                  Parameter parameter = new Parameter();
                  parameter.setPath(new CompiledPath(path, true));
                  parameter.setType(ParamType.PATH);
                  ((FunctionPathToken)token).setParameters(Arrays.asList(parameter));
                  RootPathToken functionRoot = new RootPathToken('$');
                  functionRoot.setTail(token);
                  functionRoot.setNext(token);
  
                  // Define the function as the root
                  return functionRoot;
              }
          }
          return path;
      }