void () { Pair<CancellablePromise<String>, CancellablePromise<String>> promises = WriteAction.compute( () -> Pair.create(ReadAction.nonBlocking(() -> "x").coalesceBy(new Object()).submit(AppExecutorUtil.getAppExecutorService()), ReadAction.nonBlocking(() -> "y").coalesceBy(new Object()).submit(AppExecutorUtil.getAppExecutorService()))); assertEquals("x", waitForPromise(promises.first)); assertEquals("y", waitForPromise(promises.second)); }