boolean (@NotNull ASTNode node) { IElementType nodeType = node.getElementType(); if (nodeType == JavaElementType.CLASS) { ASTNode parent = node.getTreeParent(); return parent == null || parent.getElementType() != JavaElementType.CLASS; } return nodeType == JavaElementType.CODE_BLOCK; }