public void expectNoTasks() {
            if (!tasks.isEmpty()) {
                StringBuilder sb = new StringBuilder();
                sb.append("Expected no tasks, but found these: ");
                for (TaskDescriptor td : tasks) {
                    sb.append(td.getTask()).append(" ");
                }
                throw new IllegalStateException(sb.toString());
            }
        }
Mock the executor to keep things nicely single threaded for the testing.
No need to synchronize things here since we don't use multiple threads.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java