@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    PsiElement psiElement = BasicJavaAstTreeUtil.toPsi(astNode);
    if (psiElement == null) {
      return;
    }
    if (BasicJavaAstTreeUtil.is(astNode, BASIC_CODE_BLOCK) && afterUnmatchedBrace(editor, psiElement.getContainingFile().getFileType())) {
      int stopOffset = astNode.getTextRange().getEndOffset();
      List<ASTNode> statements = BasicJavaAstTreeUtil.getChildren(astNode).stream().filter(node->
        BasicJavaAstTreeUtil.is(node, STATEMENT_SET)
      ).toList();
      if (!statements.isEmpty()) {
        stopOffset = statements.get(0).getTextRange().getEndOffset();
      }
      editor.getDocument().insertString(stopOffset, "}");
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)