def METHOD_NAME(agent_event_publisher: MagicMock, event_type: Type[Event]):
    published_events = agent_event_publisher.publish.call_args_list
    published_events = [param[0][0] for param in published_events]
    return next(event for event in published_events if isinstance(event, event_type))