@Test
    public void testWriteDistribution() throws IOException, ParseException, Distribution.TooFewBucketBitsInUseException, Distribution.NoDistributorsAvailableException {
        String clusterState = "distributor:9";
        String distributionConfig =
                """
                        redundancy 3
                        group[4]
                        group[0].index "invalid"
                        group[0].name "invalid"
                        group[0].partitions 1|2|*
                        group[0].nodes[0]
                        group[1].index 1
                        group[1].capacity 2.0
                        group[1].name group1
                        group[1].partitions *
                        group[1].nodes[3]
                        group[1].nodes[0].index 0
                        group[1].nodes[1].index 1
                        group[1].nodes[2].index 2
                        group[2].index 2
                        group[2].capacity 3.0
                        group[2].name group2
                        group[2].partitions *
                        group[2].nodes[3]
                        group[2].nodes[0].index 3
                        group[2].nodes[1].index 4
                        group[2].nodes[2].index 5
                        group[3].index 3
                        group[3].capacity 5.0
                        group[3].name group3
                        group[3].partitions *
                        group[3].nodes[3]
                        group[3].nodes[0].index 6
                        group[3].nodes[1].index 7
                        group[3].nodes[2].index 8
                        """;
        writeDistributionTest("depth2", clusterState, distributionConfig);

        clusterState = "distributor:20 storage:20";
        String complexDistributionConfig =
                """
                        redundancy 5
                        group[7]
                        group[0].partitions "*|*"
                        group[0].index "invalid"
                        group[0].name "invalid"
                        group[0].nodes[0]
                        group[1].partitions "1|*"
                        group[1].index "0"
                        group[1].name "switch0"
                        group[1].nodes[0]
                        group[2].partitions ""
                        group[2].index "0.0"
                        group[2].name "rack0"
                        group[2].nodes[4]
                        group[2].nodes[0].index 0
                        group[2].nodes[1].index 1
                        group[2].nodes[2].index 2
                        group[2].nodes[3].index 3
                        group[3].partitions ""
                        group[3].index "0.1"
                        group[3].name "rack1"
                        group[3].nodes[4]
                        group[3].nodes[0].index 8
                        group[3].nodes[1].index 9
                        group[3].nodes[2].index 14
                        group[3].nodes[3].index 15
                        group[4].partitions "*"
                        group[4].index "1"
                        group[4].name "switch1"
                        group[4].nodes[0]
                        group[5].partitions ""
                        group[5].index "1.0"
                        group[5].name "rack0"
                        group[5].nodes[4]
                        group[5].nodes[0].index 4
                        group[5].nodes[1].index 5
                        group[5].nodes[2].index 6
                        group[5].nodes[3].index 17
                        group[6].partitions ""
                        group[6].index "1.1"
                        group[6].name "rack1"
                        group[6].nodes[4]
                        group[6].nodes[0].index 10
                        group[6].nodes[1].index 12
                        group[6].nodes[2].index 13
                        group[6].nodes[3].index 7""";
        writeDistributionTest("depth3", clusterState, complexDistributionConfig);

        clusterState = "distributor:20 storage:20 .3.c:3 .7.c:2.5 .12.c:1.5";
        writeDistributionTest("capacity", clusterState, complexDistributionConfig);

        clusterState = "distributor:20 storage:20 .3.r:2 .7.r:3 .12.r:5";
        writeDistributionTest("retired", clusterState, complexDistributionConfig);
    }
The java side runs unit tests first. Thus java side will generate the distribution tests that the C++ side will verify equality with.
The tests serialized by the java side will be checked into version control, such that C++ side can test without java side. When one of the sides
change, the failing side can be identified by checking if the serialized files are modified from what is checked into version control.
vdslib/src/test/java/com/yahoo/vdslib/distribution/DistributionTestCase.java