@NotNull
  private static GeneralCommandLine createDiffCommandLine(@Nullable Project project,
                                                          @NotNull ExternalDiffSettings.ExternalTool externalTool,
                                                          @NotNull List<? extends DiffContent> contents,
                                                          @NotNull List<String> titles,
                                                          @Nullable String windowTitle) throws IOException {
    assert contents.size() == 2 || contents.size() == 3;
    assert titles.size() == contents.size();

    // Do not clean up - we do not know when the tool is terminated
    List<InputFile> files = createInputFiles(project, contents, titles, windowTitle);

    Map<String, String> patterns = new HashMap<>();
    if (files.size() == 2) {
      patterns.put("%1", files.get(0).getPath());
      patterns.put("%2", files.get(1).getPath());
      patterns.put("%3", "");
    }
    else {
      patterns.put("%1", files.get(0).getPath());
      patterns.put("%2", files.get(2).getPath());
      patterns.put("%3", files.get(1).getPath());
    }

    return createCommandLine(externalTool.getProgramPath(), externalTool.getArgumentPattern(), patterns);
  }
@NotNull
  private static GeneralCommandLine createDiffCommandLine(@Nullable Project project,
                                                          @NotNull ExternalDiffSettings.ExternalTool externalTool,
                                                          @NotNull List<? extends DiffContent> contents,
                                                          @NotNull List<String> titles,
                                                          @Nullable String windowTitle)