exceptionHolder::set, finallyCount::incrementAndGet, executorService()); exceptionHolder::set, finallyCount::incrementAndGet, executorService()); Assert.assertTrue("Unexpected exception set (failed task)", exceptionHolder.get() instanceof IntentionalException); Assert.assertEquals("Unexpected number of finally runs (failed task)", 1, finallyCount.get());