@Test
public void testWhenTwoThreadsBroadcast_thenTheFirstAlwaysSucceedsAndTheSecondAlwaysFails() throws InterruptedException {

    WithinAppNotificationRouter router = WithinAppNotificationRouter.get();
    NotificationBus<Notification> bus = new TestBus();
    router.registerExecutionLayer(new NonExecutingEventScheduler(TestSchedulerType.TEST_SCHEDULER_TYPE, TimeProvider.NULL), bus);
    OuterNotificationHandler outerHandler = new OuterNotificationHandler();
    router.addHandler(outerHandler);
    TwoThreadTestBroadcaster firstBroadcaster = new TwoThreadTestBroadcaster(router);
    new Thread(firstBroadcaster::runExpectingSuccess).start();
    firstBroadcaster.waitForCount(10);  // Ensure that thread 1 calls broadcast at least once *before* starting thread 2
    TwoThreadTestBroadcaster secondBroadcaster = new TwoThreadTestBroadcaster(router);
    new Thread(secondBroadcaster::runExpectingFailure).start();;
    secondBroadcaster.waitForCount(100);  // Ensure thread 2 has called broadcast at least once
    firstBroadcaster.waitForCount(firstBroadcaster.broadcastCount + 100);  // Make sure we're still running thread 1
    firstBroadcaster.waitToStop();
    secondBroadcaster.waitToStop();
    Assertions.assertFalse(firstBroadcaster.failed, "Should never throw as first caller");
    Assertions.assertFalse(secondBroadcaster.failed, "Should never succeed as second caller");
}