@Test(expected = IllegalArgumentException.class)
public void createWithSpecificConfAndNotEnoughWeights() throws IOException {

    XMemcachedConfiguration conf = new XMemcachedConfiguration();
    conf.setConsistentHashing(true);
    conf.setOperationTimeout(10);
    conf.setUseBinaryProtocol(false);
    conf.setConnectionPoolSize(1);
    conf.setMaxAwayTime(100);
    conf.setOptimizeGet(true);
    conf.setSanitizeKeys(true);
    // 2 servers but only 1 weight
    conf.setWeights(new int[] { 4 });
    List<InetSocketAddress> addrs = Arrays.asList(new InetSocketAddress(12345), new InetSocketAddress(12346));
    factory.create(addrs, conf);
}