'Find the common ancestor between this history node and \'other\'.
:param other:    the PathHistory to find a common ancestor with.
:return:        the common ancestor SimStateHistory, or None if there isn\'t one'

def closest_common_ancestor(self, other):

    our_history_iter = reversed(HistoryIter(self))
    their_history_iter = reversed(HistoryIter(other))
    sofar = set()
    while True:
        our_done = False
        their_done = False
        try:
            our_next = next(our_history_iter)
            if (our_next in sofar):
                return our_next
            sofar.add(our_next)
        except StopIteration:
            our_done = True
        try:
            their_next = next(their_history_iter)
            if (their_next in sofar):
                return their_next
            sofar.add(their_next)
        except StopIteration:
            their_done = True
        if (our_done and their_done):
            return None
