def _getRightmost(categories):
    """
    Get rightmost toplevel category.
    categories -- list of Category, all category from database.
    """
    rightmost = None
    for cat in categories:
        if not rightmost or cat.getRight() > rightmost.getRight():
            rightmost = cat
    return rightmost