void flushCurrentCommand(int commandTimestamp, @NotNull UndoRedoStacksHolder stacksHolder) {
    if (hasActions()) {
      if (!myAdditionalAffectedDocuments.isEmpty()) {
        DocumentReference[] refs = myAdditionalAffectedDocuments.toArray(DocumentReference.EMPTY_ARRAY);
        myCurrentActions.add(new MyEmptyUndoableAction(refs));
      }

      stacksHolder.addToStacks(new UndoableGroup(myCommandName,
                                                 isGlobal(),
                                                 commandTimestamp,
                                                 myStateBefore,
                                                 myStateAfter,
                                                 myCurrentActions,
                                                 stacksHolder,
                                                 myManager.getProject(),
                                                 myUndoConfirmationPolicy,
                                                 isTransparent(),
                                                 myValid));
    }

    reset();
  }
void flushCurrentCommand(int commandTimestamp, @NotNull UndoRedoStacksHolder stacksHolder)