@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    if (BasicJavaAstTreeUtil.is(astNode, BASIC_RECORD_COMPONENT)) {
      astNode = BasicJavaAstTreeUtil.getRecordComponentContainingClass(astNode);
    }
    if (!(BasicJavaAstTreeUtil.is(astNode, CLASS_SET)) ||
        BasicJavaAstTreeUtil.is(astNode, BASIC_TYPE_PARAMETER)) {
      return;
    }

    if (BasicJavaAstTreeUtil.getLBrace(astNode) == null && astNode != null) {
      ASTNode lastChild = astNode.getLastChildNode();
      int offset = astNode.getTextRange().getEndOffset();
      if (BasicJavaAstTreeUtil.is(lastChild, TokenType.ERROR_ELEMENT)) {
        ASTNode previous = lastChild.getTreePrev();
        if (BasicJavaAstTreeUtil.isWhiteSpace(previous)) {
          offset = previous.getTextRange().getStartOffset();
        }
        else {
          offset = lastChild.getTextRange().getStartOffset();
        }
      }
      if (BasicJavaAstTreeUtil.isInterfaceEnumClassOrRecord(astNode, JavaTokenType.RECORD_KEYWORD) &&
          BasicJavaAstTreeUtil.getRecordHeader(astNode) == null) {
        editor.getDocument().insertString(offset, "() {}");
        editor.getCaretModel().moveToOffset(offset + 1);
        processor.setSkipEnter(true);
      }
      else {
        processor.insertBracesWithNewLine(editor, offset);
        editor.getCaretModel().moveToOffset(offset + 1);
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)