code: public void afterMethodHook(String hookedClassQualifiedName, String hookedMethodSimpleName) {
          if (currentRunResult == null) {
              return; // maybe called outside of the root method
          }
          TestMethod rootMethod = currentRunResult.getRootMethod();
          if (!rootMethod.getTestClassKey().equals(hookedClassQualifiedName)
                  || !rootMethod.getSimpleName().equals(hookedMethodSimpleName)) {
              return; // hooked method is not current root method
          }
  
          long currentTime = System.currentTimeMillis();
          currentRunResult.setExecutionTime((int) (currentTime - startMethodTime));
          logger.info("afterMethodHook: " + hookedMethodSimpleName);
  
          // use encoded name to avoid various possible file name encoding problem
          // and to escape invalid file name character (Method name may contain such characters
          // if method is Groovy method, for example).
          File runResultFile = new File(String.format("%s/%s/%s", runResultsRootDir,
                  CommonUtils.encodeToSafeAsciiFileNameString(hookedClassQualifiedName, StandardCharsets.UTF_8),
                  CommonUtils.encodeToSafeAsciiFileNameString(hookedMethodSimpleName, StandardCharsets.UTF_8)));
          if (runResultFile.getParentFile() != null) {
              runResultFile.getParentFile().mkdirs();
          }
          // write runResult to YAML file
          YamlUtils.dump(currentRunResult.toYamlObject(), runResultFile);
  
          // clear current captureNo and runResult
          currentCaptureNo = -1;
          currentRunResult = null;
          currentActualRootMethodSimpleName = null;
      }
docs: write runResult to YAML file if the method for the arguments is root method