@staticmethod
def _forest_to_root_nodes(forest):
    """Return the root nodes of all the trees in forest"""
    root_nodes = []
    for tree in forest:
        if isinstance(tree, dict):
            root_nodes.append(list(tree.keys())[0])
        else:
            root_nodes.append(tree)
    return root_nodes
