def METHOD_NAME(self, first, second, msg=None):
    # XXX: Compare sets as the order of event handlers cannot be
    #      relied on between objects.
    if not set(first) == set(second):
        raise self.failureException(
            msg or f'{first!r} != {second!r}')