void () { ExecutorService executor = AppExecutorUtil.createBoundedApplicationPoolExecutor(StringUtil.capitalize(getName()), 10); for (int i = 0; i < 50; i++) { List<Disposable> parents = IntStreamEx.range(100).mapToObj(__ -> Disposer.newDisposable()).toList(); List<Future<?>> futures = new ArrayList<>(); for (Disposable parent : parents) { futures.add(executor.submit(() -> ReadAction.nonBlocking(() -> {}).expireWith(parent).submit(executor).get())); futures.add(executor.submit(() -> { try { ReadAction.nonBlocking(() -> {}).expireWith(parent).executeSynchronously(); } catch (ProcessCanceledException ignore) { } })); } parents.forEach(Disposer::dispose); futures.forEach(f -> PlatformTestUtil.waitForFuture(f, 50_000)); } }