@Test
    public void testRepliesWrongOrderDuringStateChange() throws Exception{
        {
            setClusterNodes(new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
            RoutingNode target1 = select();
            RoutingNode target2 = select();
            replyWrongDistribution(target2, "foo", 0, "version:2 bits:16 distributor:10");
            replyWrongDistribution(target1, "foo", 5, "version:1 bits:16 distributor:10 ." + bucketOneNodePreference[0] + ".s:d");
            sendToCorrectNode("foo", bucketOneNodePreference[0]);
        }
        tearDown();
        setUp();
        {
            setClusterNodes(new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
            RoutingNode target1 = select();
            RoutingNode target2 = select();
            replyWrongDistribution(target2, "foo", 0, "version:1 bits:16 distributor:10");
            replyWrongDistribution(target1, "foo", 5, "version:2 bits:16 distributor:10 ." + bucketOneNodePreference[0] + ".s:d");
            sendToCorrectNode("foo", bucketOneNodePreference[1]);
        }
    }
Test that we can identify newest cluster state and hang on to correct one.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/storagepolicy/BasicTests.java