void () { List<Integer> childLog = new ArrayList<>(); service().runTaskSynchronously(new DumbModeTaskWithEquivalentObject("parent") { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { final String commonEquivalence = "child"; DumbModeTask taskA = new DumbModeTaskWithEquivalentObject(commonEquivalence) { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { childLog.add(1); } }; DumbModeTask taskB = new DumbModeTaskWithEquivalentObject(commonEquivalence) { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { childLog.add(-1); } }; //both taskA and taskB submits the same equality object, it must run both service().runTaskSynchronously(taskA); service().runTaskSynchronously(taskB); } }); Assert.assertEquals("All tasks should run, but were: " + childLog, 2, childLog.size()); }