def METHOD_NAME(tree: Group):
    expected_indices = [
        0,
        1,
        (1, 0),
        (1, 1),
        (1, 1, 0),
        (1, 1, 1),
        (1, 2),
        (1, 3),
        (1, 4),
        2,
        3,
    ]
    assert list(tree._iter_indices()) == expected_indices
    for index in tree._iter_indices():
        assert tree.index(tree[index]) == index
        item = tree[index]
        if item.parent:
            assert item.parent.index(item) is not None