private static void assertSelect(PolicyTestFrame frame, int numSelects, List<String> expected) {
        Set<String> lst = new TreeSet<>();

        for (int i = 0; i < numSelects; ++i) {
            if (!expected.isEmpty()) {
                RoutingNode leaf = frame.select(1).get(0);
                String recipient = leaf.getRoute().toString();
                lst.add(recipient);
                leaf.handleReply(new EmptyReply());
            } else {
                frame.select(0);
            }
            assertNotNull(frame.getReceptor().getReply(TIMEOUT));
        }

        assertEquals(expected.size(), lst.size());
        Iterator<String> it = lst.iterator();
        for (String recipient : expected) {
            assertEquals(recipient, it.next());
        }
    }
Ensures that the given number of select passes on the given frame produces an expected list of recipients.

@param frame      The frame to select on.
@param numSelects The number of selects to perform.
@param expected   The list of expected recipients.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/PolicyTestCase.java