private @NotNull ModCommand getCommand() {
      if (myRenameSymbol != null && !myTemplateFields.isEmpty()) {
        throw new IllegalStateException("Cannot have both rename and template commands");
      }
      if (myErrorMessage != null) {
        return error(myErrorMessage);
      }
      if (ContainerUtil.exists(myChangedFiles.values(), ft -> ft.myGuardModification)) {
        return error(AnalysisBundle.message("modcommand.executor.modification.of.guarded.region"));
      }
      return ModCommand.showConflicts(myConflictMap)
        .andThen(myChangedFiles.values().stream()
          .map(fileTracker -> fileTracker.getUpdateCommand()).reduce(nop(), ModCommand::andThen))
        .andThen(myChangedDirectories.values().stream()
                   .flatMap(info -> info.createFileCommands(myTracker.myProject))
                   .reduce(nop(), ModCommand::andThen))
        .andThen(getNavigateCommand()).andThen(getHighlightCommand()).andThen(getTemplateCommand())
        .andThen(myTrackedDeclarations.stream().<ModCommand>map(c -> c).reduce(nop(), ModCommand::andThen))
        .andThen(myRenameSymbol == null ? nop() : myRenameSymbol)
        .andThen(myInfoMessage == null ? nop() : ModCommand.info(myInfoMessage));
    }
private @NotNull ModCommand getCommand()