private void checkTaskAcceptance() {
            if (rejectTasksAfter == 0) {
                throw new RejectedExecutionException("rejectTasksAfter is 0; rejecting task");
            } else if (rejectTasksAfter > 0) {
                --rejectTasksAfter;
            }
        }
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