void (@NotNull Throwable ex) { COUNT.set(0); assertTrue(ex.getMessage().contains("myMsg")); List<Object> objects = Collections.nCopies(100_000, null); UsefulTestCase.assertThrows(ex.getClass(), "myMsg", () -> JobLauncher.getInstance().invokeConcurrentlyUnderProgress(objects, null, __ -> { if (COUNT.incrementAndGet() == 10_000) { LOG.debug("PCE"); if (ex instanceof Error) { throw (Error)ex; } else { throw (RuntimeException)ex; } } return true; })); }