@Test
public void testTokenDistribution() throws Exception {

    List<Long> tokens = Arrays.asList(611697721L, 2043353485L, 3475009249L);
    DynoBinarySearch<Long> search = new DynoBinarySearch<Long>(tokens);
    Map<Long, Long> tokenCount = new HashMap<Long, Long>();
    tokenCount.put(611697721L, 0L);
    tokenCount.put(2043353485L, 0L);
    tokenCount.put(3475009249L, 0L);
    Murmur1HashPartitioner hash = new Murmur1HashPartitioner();
    for (int i = 0; i < 1000000; i++) {
        // Compute the hash
        long lHash = hash.hash("" + i);
        // Now lookup the node
        Long token = search.getTokenOwner(lHash);
        Long count = tokenCount.get(token);
        count++;
        tokenCount.put(token, count);
    }
    long total = 0;
    for (Long value : tokenCount.values()) {
        total += value;
    }
    for (Long token : tokenCount.keySet()) {
        Long value = tokenCount.get(token);
        Long percent = value * 100 / total;
        Assert.assertTrue("Percentage is off for tokenCount: " + tokenCount, percent >= 30 && percent <= 35);
    }
}