private static boolean vmOptionsRequiresMerge(@Nullable Path oldConfigDir, Path newConfigDir, Logger log){
    if (oldConfigDir == null) {
      return false;
    }
    if (newConfigDir == null) {
      return true;
    }
    Path importFile = oldConfigDir.resolve(VMOptions.getFileName());
    Path currentFile = newConfigDir.resolve(VMOptions.getFileName());
    try {
      if (!Files.isRegularFile(importFile))
        return false;
      if (!Files.isRegularFile(currentFile))
        return true;

      var cs = VMOptions.getFileCharset();
      var importLines = Files.readAllLines(importFile, cs);
      var currentLines = Files.readAllLines(currentFile, cs);
      currentLines.sort(String::compareTo);
      ArrayList<String> result = mergeVmOptionsLines(importLines, currentLines, log);
      updateVMOptionsLines(newConfigDir, result, log);
      result.sort(String::compareTo);
      return !currentLines.equals(result);
    }
    catch (IOException e) {
      log.warn("Failed to merge VM option files " + importFile + " and " + currentFile, e);
      return true;
    }
  }
private static boolean vmOptionsRequiresMerge(@Nullable Path oldConfigDir, Path newConfigDir, Logger log)