@Test
public void _15_taskPool() {

    try {
        int nbTasks = 10;
        CountDownLatch latch = new CountDownLatch(nbTasks);
        AtomicInteger reportsCount = new AtomicInteger();
        long ts0 = System.currentTimeMillis();
        Task withProgress = Tasks.newTask().action(PluginForWorkersTest.PROGRESS_REPORTS);
        TaskContext taskContext = withProgress.prepare(null, null, result -> {
            long ts1 = System.currentTimeMillis();
            //assertEquals(10, reportsCount.get());
            //System.out.println("Duration: " + (ts1 - ts0) + "ms");
            latch.countDown();
        });
        taskContext.setProgressHook(result -> {
            //System.out.println("Progress: " + result.progress() + " Comment:" + result.comment());
            reportsCount.incrementAndGet();
        });
        for (int i = 0; i < nbTasks; i++) {
            localWorker.submitPreparedTask(withProgress, taskContext, MailboxRegistry.getInstance().getDefaultMailboxId());
        }
        latch.await();
        assertEquals(10 * nbTasks, reportsCount.get());
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}