@Test
public void testReplicationFactorOf3() {

    cpConfig.setLocalRack("us-east-1c");
    cpConfig.setLoadBalancingStrategy(LoadBalancingStrategy.TokenAware);
    cpConfig.withTokenSupplier(getTokenMapSupplier());
    HostSelectionWithFallback<Integer> selection = new HostSelectionWithFallback<Integer>(cpConfig, cpMonitor);
    List<HostToken> hostTokens = Arrays.asList(
            new HostToken(1111L, new HostBuilder().setHostname("host-1").setPort(-1).setRack(rack1).createHost()),
            new HostToken(1111L, new HostBuilder().setHostname("host-2").setPort(-1).setRack(rack1).createHost()),
            new HostToken(1111L, new HostBuilder().setHostname("host-3").setPort(-1).setRack(rack1).createHost()),
            new HostToken(2222L, new HostBuilder().setHostname("host-4").setPort(-1).setRack(rack1).createHost()),
            new HostToken(2222L, new HostBuilder().setHostname("host-5").setPort(-1).setRack(rack1).createHost()),
            new HostToken(2222L, new HostBuilder().setHostname("host-6").setPort(-1).setRack(rack1).createHost())
    );
    int rf = selection.calculateReplicationFactor(hostTokens);
    Assert.assertEquals(3, rf);
}