@Test
public void getTaskUpdates() {

    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicInteger tasksCount = new AtomicInteger(0);
    titusClient.getJobAndTaskUpdates().subscribe(task -> {
        if (tasksCount.incrementAndGet() == 5) {
            latch.countDown();
        }
    }, e -> fail("getTaskUpdates exception {}", e));
    try {
        latch.await(1, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
        fail("getTaskUpdates Timeout ", e);
    }
}