### Question:
Shard { static int indexWithinShard(int idx) { return idx & SHARD_MASK; }    }### Answer:
@Test public void testIndexWithinShard() { for (int i: someIntegers(0)) { assertThat(Shard.indexWithinShard(i), equalTo(i % Shard.SHARD_SIZE)); } }