Get the root of the tree

@return the root of the tree or EMPTY_SLOT if the tree is empty
514142
@Nonnull
  public ExpressionTreeElement getRoot() {
    if (last.isEmptySlot()) {
      return this.last;
    } else {
      ExpressionTreeElement element = last;
      while (!Thread.currentThread().isInterrupted()) {
        final ExpressionTreeElement next = element.getParent();
        if (next == null) {
          return element;
        } else {
          element = next;
        }
      }
    }
    return ExpressionTreeElement.EMPTY_SLOT;
  }
874132
private DefaultTreeModel getTreeModel() {
        if (treeModel == null) {
            treeModel = new DefaultTreeModel(getRootNode());
            treeModel.setRoot(getRootNode());
        }
        
        return treeModel;
    }
574663
public java.lang.String getRootElement() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.rootElement);

    }
813934
@Override
    protected String getRoot() {
        JsonObject result = ((JsonObject) new JsonParser().parse(raw));
        String root = null;
        for(Map.Entry<String, JsonElement> member : result.entrySet()) {
            root = member.getKey();
        }
        return root;
    }
915378
def root(self):
        
        node = self
        while node.package is not None:
            node = node.package
        return node
1154028
protected function findBaseRootElementOrNull()
    {
        $qb = parent::createBaseQueryBuilder();

        $qb->andWhere($qb->getRootAliases()[0] . '.isRoot = 1');
        $qb->andWhere($qb->getRootAliases()[0] . '.parent IS NULL');

        $root = $qb->getQuery()->getOneOrNullResult();

        return $root;
    }
1143809
public Node getRoot(Node node)
  {

    Node root = null;

    while (node != null)
    {
      root = node;
      node = getParentOfNode(node);
    }

    return root;
  }
897063
def root *args, &block
      return @root if args.empty?
      node = args[0]
      @asks_allow_children = args[1]
      if !node.is_a? TreeNode
        n = TreeNode.new node
        node = n
      end
      @root = node
      $log.debug " XXX def root created root with #{node} "
      #add node, true, &block 
      instance_eval &block if block_given?
    end
119001
public function getRootIndi() {
        $root_indi_id = $this->getRootIndiId();
        if(!empty($root_indi_id)) {
            return Individual::getInstance($root_indi_id, $this->tree);
        }
        return null;
    }
322220
private function getRoot()
	{
		if ($this->root === NULL)
		{
			$selector = reset($this->parameters);
			$strategy = key($this->parameters);
			if ($selector instanceof Element)
			{
				$this->root = $selector;
			}
			else
			{
				$this->root = $this->parent->findElement($strategy, $selector);
			}
			$expectedTagName = next($this->parameters);
			$expectedAttributes = next($this->parameters);
			if ($expectedTagName !== FALSE)
			{
				$actualTagName = $this->root->name();
				if ($actualTagName !== $expectedTagName)
				{
					throw new ViewStateException("Root element of '" . get_class($this) . "' is expected to be tag '$expectedTagName', but is '$actualTagName'.");
				}
			}
			if ($expectedAttributes !== FALSE)
			{
				foreach ($expectedAttributes as $attributeName => $expectedAttributeValue)
				{
					$actualAttributeValue = $this->root->attribute($attributeName);
					if ($actualAttributeValue !== $expectedAttributeValue)
					{
						throw new ViewStateException("Root element's attribute '$attributeName' is expected to be '$expectedAttributeValue', but is '$actualAttributeValue'.");
					}
				}
			}
		}
		return $this->root;
	}
517633
public static TreeElement getRoot(TreeElement node)
    {
        TreeElement parentNode = node.getParent();
        while (parentNode != null) {
            node = parentNode;
            parentNode = node.getParent();
        }
        return node;
    }
864733
def get_merkle_root(merkle_tree: MerkleTree) -> bytes:
    
    assert merkle_tree.layers, 'the merkle tree layers are empty'
    assert merkle_tree.layers[-1], 'the root layer is empty'

    return merkle_tree.layers[-1][0]
719763
def get_root_item(self, item):
        """"""
        root_item = item
        while isinstance(root_item.parent(), QTreeWidgetItem):
            root_item = root_item.parent()
        return root_item
35701
@SuppressWarnings("unchecked")
	@Pure
	public Tree<RoadPolyline, ?> getInternalTree() {
		if (this.roadSegments instanceof GISTreeSet<?, ?>) {
			return ((GISTreeSet<RoadPolyline, ?>) this.roadSegments).getTree();
		}
		return null;
	}
372795
public Exception getRootCause() {
		if (exception instanceof ServiceLocatorException) {
			return ((ServiceLocatorException) exception).getRootCause();
		}
		return exception == null ? this : exception;
	}
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;
	}
639550
final TreeMapEntry<K,V> getLastEntry() {
        TreeMapEntry<K,V> p = root;
        if (p != null)
            while (p.right != null)
                p = p.right;
        return p;
    }