@Test
    public void testMax1ConcurrentSendCreateVisitorsTask() {
        MockComponents mc = createDefaultMock();

        mc.executor.setMockTimeMs(1000);
        mc.visitorSession.start();
        mc.executor.expectAndProcessTasks(1);
        assertEquals(2, mc.sender.getMessageCount());

        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000000)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n)",
                replyToCreateVisitor(mc.sender, new BucketId(0x8400000100000000L)));

        // Execute reply task which will schedule a SendCreateVisitors task.
        mc.executor.expectAndProcessTasks(1);
        assertEquals(1, mc.executor.getScheduledTaskCount());
        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000001)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n)",
                replyToCreateVisitor(mc.sender, new BucketId(0x8400000100000001L)));
        // Execute reply task which should _not_ schedule a SendCreateVisitors task
        // since one has already been scheduled. Note that since the second reply
        // task was directly submitted rather than scheduled, it should always be
        // executed before the SendCreateVisitors task in our deterministic test
        // environment.
        mc.executor.expectAndProcessTasks(2, 1);
        // Finally execute scheduled SendCreateVisitors task.
        mc.executor.expectAndProcessTasks(1);
        mc.executor.expectNoTasks();
        assertEquals(2, mc.sender.getMessageCount());
    }
Test that different visitors within the same session get different
names.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java