void replace(@NotNull String variableText) {
      PsiNewExpression newExpression = (PsiNewExpression)variable.getInitializer();
      assert newExpression != null;
      PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass();
      assert anonymousClass != null;
      PsiElement lBrace = anonymousClass.getLBrace();
      PsiElement rBrace = anonymousClass.getRBrace();
      if (lBrace == null || rBrace == null) return;
      StringBuilder expressionText = new StringBuilder();
      for (PsiElement child = newExpression.getFirstChild(); child != null; child = child.getNextSibling()) {
        if (child == anonymousClass) break;
        expressionText.append(child.getText());
      }
      for (PsiElement child = anonymousClass.getFirstChild(); child != null; child = child.getNextSibling()) {
        if (!isBefore && child == rBrace) expressionText.append(variableText);
        expressionText.append(child.getText());
        if (isBefore && child == lBrace) expressionText.append(variableText);
      }
      PsiElementFactory factory = JavaPsiFacade.getElementFactory(variable.getProject());
      variable.setInitializer(factory.createExpressionFromText(expressionText.toString(), variable));
      PsiTypeElement typeElement = variable.getTypeElement();
      if (!typeElement.isInferredType()) {
        typeElement.replace(factory.createTypeElementFromText("var", variable));
      }
    }
void replace(@NotNull String variableText)