private static void writeOptionsToFile(File file,
                                         String sessionDataFilePath,
                                         String @Nullable [] patterns,
                                         String[] excludePatterns,
                                         String[] excludeAnnotations,
                                         boolean testTracking,
                                         boolean branchCoverage,
                                         String sourceMapPath) throws IOException {
    write2file(file, sessionDataFilePath);
    write2file(file, String.valueOf(testTracking));
    write2file(file, Boolean.FALSE.toString()); //append unloaded
    write2file(file, String.valueOf(Registry.is("idea.coverage.merge.report"))); //merge with existing
    write2file(file, String.valueOf(!branchCoverage));
    if (sourceMapPath != null) {
      write2file(file, Boolean.TRUE.toString());
      write2file(file, sourceMapPath);
    }
    if (patterns != null) {
      writePatterns(file, patterns);
    }
    if (excludePatterns != null) {
      write2file(file, "-exclude");
      writePatterns(file, excludePatterns);
    }
    if (!ArrayUtil.isEmpty(excludeAnnotations)) {
      write2file(file, "-excludeAnnotations");
      writePatterns(file, excludeAnnotations);
    }
  }
private static void writeOptionsToFile(File file,
                                         String sessionDataFilePath,
                                         String @Nullable [] patterns,
                                         String[] excludePatterns,
                                         String[] excludeAnnotations,
                                         boolean testTracking,
                                         boolean branchCoverage,
                                         String sourceMapPath)