private static void replaceRedundantEmbeddedExpression(PsiTemplateExpression template) {
      while (template != null && template.getTemplate() != null) {
        List<@NotNull PsiExpression> expressions = template.getTemplate().getEmbeddedExpressions();
        for (PsiExpression expression : expressions) {
          if (RedundantEmbeddedExpressionInspection.isEmbeddedLiteralRedundant(expression)) {
            template = RedundantEmbeddedExpressionInspection.inlineEmbeddedExpression(expression);
            if (template != null) break; // try again replacement with new embedded expressions
          }
          template = null; // finish
        }
      }
    }
private static void replaceRedundantEmbeddedExpression(PsiTemplateExpression template)