private MessageBusVisitorSession createVisitorSession(MockSender sender,
                                                          MockReceiver receiver,
                                                          MockAsyncTaskExecutor executor,
                                                          VisitorParameters visitorParameters,
                                                          RoutingTable routingTable,
                                                          MockClock clock)
    {
        if (routingTable == null) {
            routingTable = new RoutingTable(new RoutingTableSpec(DocumentProtocol.NAME));
        }
        try {
            return new MessageBusVisitorSession(
                    visitorParameters,
                    executor,
                    new MockSenderFactory(sender),
                    new MockReceiverFactory(receiver),
                    routingTable,
                    clock);
        } catch (ParseException e) {
            throw new IllegalArgumentException("Bad document selection", e);
        }
    }
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