@Test
public void testBadSubscriberIsolation() {

    jobManagerStub.moveTaskToState(taskId1, TaskState.Started);
    eurekaServer.register(newInstanceInfo(taskId1, InstanceStatus.UP));
    // First event / one subscriber
    TitusRxSubscriber<ContainerHealthEvent> subscriber1 = new TitusRxSubscriber<>();
    healthService.events(false).subscribe(subscriber1);
    eurekaServer.triggerCacheRefreshUpdate();
    // Add bad subscriber
    Disposable subscription2 = healthService.events(false).subscribe(
            next -> {
                throw new RuntimeException("simulated error");
            },
            e -> {
                throw new RuntimeException("simulated error");
            },
            () -> {
                throw new RuntimeException("simulated error");
            }
    );
    // Event 2
    registerAndRefresh(InstanceStatus.DOWN);
    assertThat(subscription2.isDisposed()).isTrue();
    // Event 3
    registerAndRefresh(InstanceStatus.UP);
    assertThat(subscriber1.isDisposed()).isFalse();
    assertThat(subscriber1.getAllItems()).hasSize(3);
}