@Test
public void testIndexOutOfBounds() throws IOException, NoSuchAlgorithmException, SharderException {

    HashSharder sharder = new HashSharder(3);
    Random rg = new Random();
    for (int i = 0; i < 100; i++) {
        int shard = sharder.getShard("foo" + rg.nextInt());
        assertTrue("shard should be between 0 (inclusive) and 3 (exclusive)", shard >= 0 && shard < 3);
    }
}