@Test
    public void testEvenDistribution() {
        MockRandom random = new MockRandom();
        StripedReplicaPlacer placer = new StripedReplicaPlacer(random);
        TopicAssignment topicAssignment = place(placer, 0, 200, (short) 2, Arrays.asList(
            new UsableBroker(0, Optional.empty(), false),
            new UsableBroker(1, Optional.empty(), false),
            new UsableBroker(2, Optional.empty(), false),
            new UsableBroker(3, Optional.empty(), false)));
        Map<List<Integer>, Integer> counts = new HashMap<>();
        for (PartitionAssignment partitionAssignment : topicAssignment.assignments()) {
            counts.put(partitionAssignment.replicas(), counts.getOrDefault(partitionAssignment.replicas(), 0) + 1);
        }
        assertEquals(14, counts.get(Arrays.asList(0, 1)));
        assertEquals(22, counts.get(Arrays.asList(0, 2)));
        assertEquals(14, counts.get(Arrays.asList(0, 3)));
        assertEquals(17, counts.get(Arrays.asList(1, 0)));
        assertEquals(17, counts.get(Arrays.asList(1, 2)));
        assertEquals(16, counts.get(Arrays.asList(1, 3)));
        assertEquals(13, counts.get(Arrays.asList(2, 0)));
        assertEquals(17, counts.get(Arrays.asList(2, 1)));
        assertEquals(20, counts.get(Arrays.asList(2, 3)));
        assertEquals(20, counts.get(Arrays.asList(3, 0)));
        assertEquals(19, counts.get(Arrays.asList(3, 1)));
        assertEquals(11, counts.get(Arrays.asList(3, 2)));
    }
Test that we will place on the fenced replica if we need to.
metadata/src/test/java/org/apache/kafka/metadata/placement/StripedReplicaPlacerTest.java