ASTNode (@NotNull IElementType type) { if (DebugUtil.CHECK_INSIDE_ATOMIC_ACTION_ENABLED){ assertReadAccessAllowed(); } for(ASTNode element = getFirstChildNode(); element != null; element = element.getTreeNext()){ if (element.getElementType() == type) return element; } return null; }