void (@NotNull PsiStatement statement, @NotNull PsiPatternVariable variable) { String text = getDeclarationStatement(variable); if (text == null) { return; } Project project = statement.getProject(); PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); PsiStatement declarationStatement = factory.createStatementFromText(text, statement); BlockUtils.addBefore(statement, declarationStatement); }