@Test
    public void testVisitAll() {
        MockSender sender = new MockSender();
        MockReceiver receiver = new MockReceiver();
        sender.setMaxPending(1000);
        MockAsyncTaskExecutor executor = new MockAsyncTaskExecutor();
        VisitorParameters params = createVisitorParameters("");
        MessageBusVisitorSession visitorSession = createVisitorSession(
                sender, receiver, executor, params);

        visitorSession.start();
        executor.expectAndProcessTasks(1);
        assertEquals(2, sender.getMessageCount());
        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000000)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n)",
                replyToCreateVisitor(sender, ProgressToken.FINISHED_BUCKET));

        executor.expectAndProcessTasks(1);
        executor.expectNoTasks(); // No new visitors yet.

        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000001)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n)",
                replyToCreateVisitor(sender, new BucketId(8, 1 | (1 << 8))));

        executor.expectAndProcessTasks(1);
        // Send new visitor for bucket 1
        executor.expectAndProcessTasks(1);

        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000001)\n" +
                "BucketId(0x2000000000000001)\n" +
                "]\n)",
                replyToCreateVisitor(sender, ProgressToken.FINISHED_BUCKET));

        executor.expectAndProcessTasks(1); // Reply task
        executor.expectNoTasks(); // Visiting complete

        assertTrue(visitorSession.isDone());
    }
Test that using an id.user=foo selection only tries to visit a single
superbucket for that user.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java