This method as such makes no sense (you can get the root node directly from SmiMib),
but it is used mainly for unit testing.

@return The root of the oid tree.
424828
public SmiOidNode getRootNode() {
        SmiOidNode parent = this;
        while (parent.getParent() != null) {
            parent = parent.getParent();
        }
        return parent;
    }
818965
public Node getCurrentNode()
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");

    int saved = m_next;
    Node n = (m_next < m_firstFree) ? elementAt(m_next) : null;
    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
    return n;
  }
1041026
public JSONNavi<T> root() {
		this.current = this.root;
		this.stack.clear();
		this.path.clear();
		this.failure = false;
		this.missingKey = null;
		this.failureMessage = null;
		return this;
	}
1287758
public Node nextNode() {

		if (currentNode == null)
			return null;

		Node result = getFirstChild(currentNode);

		if (result != null) {
			currentNode = result;
			return result;
		}

		result = getNextSibling(currentNode);

		if (result != null) {
			currentNode = result;
			return result;
		}

		// return parent's 1st sibling.
		Node parent = getParentNode(currentNode);
		while (parent != null) {
			result = getNextSibling(parent);
			if (result != null) {
				currentNode = result;
				return result;
			} else {
				parent = getParentNode(parent);
			}
		}

		// end , return null
		return null;
	}
1247923
def get_root(self):
        """"""
        if self.is_root_node():
            return self

        return self.get_ancestors().order_by(
            "-%s__depth" % self._closure_parentref()
        )[0]
1240056
public Node parentNode() {

		if (currentNode == null)
			return null;

		Node node = getParentNode(currentNode);

		if (node != null)
			currentNode = node;

		return node;

	}
1224107
private INode findRoot() {
        for (INode node : nodes.values()) {
            if (!node.hasParent() && !BASE_NODE.equals(node.getNodeData().getName())) {
                return node;
            }
        }
        return null;
    }
119001
public function getRootIndi() {
        $root_indi_id = $this->getRootIndiId();
        if(!empty($root_indi_id)) {
            return Individual::getInstance($root_indi_id, $this->tree);
        }
        return null;
    }
830264
public String getParentIdentifier() {

        // Translate null parent to proper identifier
        String parentIdentifier = getModel().getParentIdentifier();
        if (parentIdentifier == null)
            return RootConnectionGroup.IDENTIFIER;

        return parentIdentifier;
        
    }
231761
Node getNode(Node root) {
        if (isRoot()) {
            return root;
        }

        Node startNode = root;
        Matcher pathMatcher = dotWithPreviousChar.matcher(path);
        int pos = 0;
        while (pathMatcher.find()) {
            String step = path.substring(pos, pathMatcher.end() - 1);
            pos = pathMatcher.end();
            startNode = doStep(step, startNode);
        }
        startNode = doStep(path.substring(pos), startNode);
        return startNode;
    }
783048
def getRootNode(nodes):
    ''''''
    max = 0
    root = None
    for i in nodes:
        if len(i.children) > max:
            max = len(i.children)
            root = i
    return root
869213
public LeafNode<K, V> prevNode() {
		if (leftid == NULL_ID) {
			return null;
		}
		return (LeafNode<K, V>) tree.getNode(leftid);
	}
876217
protected VertexType getNextSearchTreeRoot() {
        // FIXME: slow linear search, should improve
        for (Iterator<VertexType> i = graph.vertexIterator(); i.hasNext();) {
            VertexType vertex = i.next();
            if (visitMe(vertex)) {
                return vertex;
            }
        }
        return null;
    }
265565
def getroot(self):
        """"""
        builder = ET.TreeBuilder()
        self.build(builder)
        return builder.close()
448866
@Override
    public Root get(Root root) throws WIMException {
        final String METHODNAME = "get";
        Root result = null;
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, METHODNAME + " " + WIMTraceHelper.trace(root));
        }
        result = profileManager.get(root);
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, METHODNAME + " " + WIMTraceHelper.trace(result));
        }
        return result;
    }
994233
public TreeGraphNode highestNodeWithSameHead() {
    TreeGraphNode node = this;
    while (true) {
      TreeGraphNode parent = safeCast(node.parent());
      if (parent == null || parent.headWordNode() != node.headWordNode()) {
        return node;
      }
      node = parent;
    }
  }
145918
public Token getRoot(boolean safe) {
        Token root = getRoot();

        if (root == null && safe) {
            root = Token.NULL;
        }

        return root;
    }