ASTNode (@NotNull ASTNode fileNode) { ASTNode node = fileNode.findChildByType(JavaElementType.PACKAGE_STATEMENT); if (node == null) node = fileNode.getLastChildNode(); while (node != null && node.getElementType() != JavaDocElementType.DOC_COMMENT) { node = node.getTreePrev(); } return node; }