void () { List<Integer> list = IntStream.range(0, 100).boxed().collect(Collectors.toList()); for (int i = 0; i<10 && checkTestTimeout(i); i++) { int fingerPrint = i; COUNT.set(0); LOG.debug("--- " + i+"; fingerPrint="+fingerPrint+"; COUNT="+COUNT); boolean[] success = new boolean[1]; logElapsed(()-> UsefulTestCase.assertThrows(MyException.class, "myMsg", () -> success[0] = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(list, null, ind -> { boolean nestedSuccess = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(list, null, nestedInd -> { if (busySleepAndIncrement(1) % 1024 == 0) { LOG.debug("throw myMsg ind=" + ind + "; nestedInd=" + nestedInd+"; fingerPrint="+fingerPrint+"; COUNT="+COUNT); throw new MyException("myMsg"+fingerPrint+"; COUNT="+COUNT); } return true; }); LOG.debug("nestedSuccess: " + nestedSuccess + "; ind:" + ind+"; fingerPrint="+fingerPrint+"; COUNT="+COUNT); return true; }) )); assertFalse(success[0]); } }