@Override
    public void currentVariableChanged(@NotNull TemplateState templateState, Template template, int oldIndex, int newIndex) {
      if (!ApplicationManager.getApplication().isUnitTestMode() && (oldIndex != 0 || newIndex != 1) && (oldIndex != -1 || newIndex != -1)) {
        return;
      }

      TextResult reference = templateState.getVariableValue(VAR_NAME);
      if (reference == null) {
        return;
      }

      processDuplicates(reference.getText());
    }
@Override
    public void currentVariableChanged(@NotNull TemplateState templateState, Template template, int oldIndex, int newIndex)