@Test
    public void testPlacementOnFencedReplicaOnSingleRack() {
        MockRandom random = new MockRandom();
        RackList rackList = new RackList(random, Arrays.asList(
            new UsableBroker(3, Optional.empty(), false),
            new UsableBroker(1, Optional.empty(), true),
            new UsableBroker(2, Optional.empty(), false)).iterator());
        assertEquals(3, rackList.numTotalBrokers());
        assertEquals(2, rackList.numUnfencedBrokers());
        assertEquals(Collections.singletonList(Optional.empty()), rackList.rackNames());
        assertEquals(Arrays.asList(3, 2, 1), rackList.place(3));
        assertEquals(Arrays.asList(2, 3, 1), rackList.place(3));
        assertEquals(Arrays.asList(3, 2, 1), rackList.place(3));
        assertEquals(Arrays.asList(2, 3, 1), rackList.place(3));
    }
Test that we will place on the fenced replica if we need to.
metadata/src/test/java/org/apache/kafka/metadata/placement/StripedReplicaPlacerTest.java