ASTNode (int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch (role) { case ChildRole.DOC_COMMENT_START: return getFirstChildNode(); case ChildRole.DOC_COMMENT_END: TreeElement lastNode = getLastChildNode(); return lastNode.getElementType() == DOC_COMMENT_END ? lastNode : null; default: return null; } }