private Match templateExpressionsMatch(PsiTemplateExpression expression1, PsiTemplateExpression expression2) {
    final PsiExpression processor1 = expression1.getProcessor();
    final PsiExpression processor2 = expression2.getProcessor();
    if (expressionsMatch(processor1, processor2) != EXACT_MATCH) {
      return EXACT_MISMATCH;
    }

    if (expression1.getArgumentType() == PsiTemplateExpression.ArgumentType.TEMPLATE) {
      if (expression2.getArgumentType() != PsiTemplateExpression.ArgumentType.TEMPLATE) {
        return EXACT_MISMATCH;
      }
      final PsiTemplate template1 = expression1.getTemplate();
      final PsiTemplate template2 = expression2.getTemplate();
      if (template1 == null) {
        return template2 == null ? EXACT_MATCH : EXACT_MISMATCH;
      }
      else if (template2 == null) return EXACT_MISMATCH;
      final List<@NotNull PsiFragment> fragments1 = template1.getFragments();
      final List<@NotNull PsiFragment> fragments2 = template2.getFragments();
      if (fragments1.size() != fragments2.size()) return EXACT_MISMATCH;
      for (int i = 0, size = fragments1.size(); i < size; i++) {
        if (!Objects.equals(fragments1.get(i).getValue(), fragments2.get(i).getValue())) {
          return EXACT_MISMATCH;
        }
      }
      final List<@NotNull PsiExpression> expressions1 = template1.getEmbeddedExpressions();
      final List<@NotNull PsiExpression> expressions2 = template2.getEmbeddedExpressions();
      if (expressions1.size() != expressions2.size()) return EXACT_MISMATCH;
      for (int i = 0, size = expressions1.size(); i < size; i++) {
        if (expressionsMatch(expressions1.get(i), expressions2.get(i)) != EXACT_MATCH) {
          return EXACT_MISMATCH;
        }
      }
      return EXACT_MATCH;
    }
    else {
      if (expression2.getArgumentType() == PsiTemplateExpression.ArgumentType.TEMPLATE) {
        return EXACT_MISMATCH;
      }
      return expressionsMatch(expression1.getLiteralExpression(), expression2.getLiteralExpression());
    }
  }
private Match templateExpressionsMatch(PsiTemplateExpression expression1, PsiTemplateExpression expression2)