def METHOD_NAME(self):
    edges = {
        'r': ['w', 'y1'],
        'w': ['x1', 'x2'],
        'y1': ['y2'],
        'y2': ['x2'],
        'x2': ['x1']
    }
    expected_dominators = {
        'r': None,
        'w': 'r',
        'x1': 'r',
        'y1': 'r',
        'y2': 'y1',
        'x1': 'r',
        'x2': 'r'
    }
    self.graph.entry = 'r'
    self.graph.edges = edges
    self.graph.nodes = list(expected_dominators.keys())
    self.assertEqual(expected_dominators, self.graph.immediate_dominators())