void () { AtomicInteger executionCount = new AtomicInteger(); Executor executor = r -> { executionCount.incrementAndGet(); AppExecutorUtil.getAppExecutorService().execute(r); }; assertEquals("x", waitForPromise(WriteAction.compute(() -> { Promise<String> promise = ReadAction.nonBlocking(() -> "x").submit(executor); assertEquals(0, executionCount.get()); return promise; }))); assertEquals(1, executionCount.get()); }