@Override
    @NotNull
    PsiStatement replace(@NotNull Project project, @NotNull PsiElementFactory factory) {
      PsiExpression expression = myExpression;
      if (expression.getParent() instanceof PsiMethodCallExpression &&
          ((PsiMethodCallExpression)expression.getParent()).getMethodExpression() == expression) {
        expression = (PsiExpression)expression.getParent();
      }
      PsiType type = expression.getType();
      String typeText = type == null ? CommonClassNames.JAVA_LANG_OBJECT : type.getCanonicalText();
      String text = "new java.lang.Object() { " + typeText + " evaluate() { return x;}}.evaluate()";
      PsiMethodCallExpression anonymousCall =
        (PsiMethodCallExpression)JavaPsiFacade.getElementFactory(expression.getProject()).createExpressionFromText(text, expression);
      PsiReturnStatement returnStatement = Objects.requireNonNull(getReturnStatement(anonymousCall));
      Objects.requireNonNull(returnStatement.getReturnValue()).replace(expression);
      return Objects.requireNonNull(getReturnStatement((PsiMethodCallExpression)expression.replace(anonymousCall)));
    }
@Override
    @NotNull
    PsiStatement replace(@NotNull Project project, @NotNull PsiElementFactory factory)