### Question:
ShardIndexKeyFunctor implements KeyFunctor { static boolean isRangeInBloomFilter(Range range) { if (range.getStartKey() == null || range.getEndKey() == null) { return false; } if (!isKeyInBloomFilter(range.getStartKey())) { return false; } if (range.getStartKey().equals(range.getEndKey(), PartialKey.ROW_COLFAM)) return true; return range.getStartKey().followingKey(PartialKey.ROW_COLFAM).equals(range.getEndKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME) && !range.isEndKeyInclusive(); }  @Override org.apache.hadoop.util.bloom.Key transform(org.apache.accumulo.core.data.Key cbKey); @Override org.apache.hadoop.util.bloom.Key transform(Range range);  }### Answer:
@Test public void testIsRangeInBloomFilter() { org.apache.accumulo.core.data.Key cbKey = new org.apache.accumulo.core.data.Key(); Assert.assertFalse("empty key should not be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey, cbKey))); cbKey = new org.apache.accumulo.core.data.Key("row only"); Assert.assertFalse("row only key should not be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey, cbKey))); cbKey = new org.apache.accumulo.core.data.Key("", "cf only"); Assert.assertFalse("cf only key should not be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey, cbKey))); cbKey = new org.apache.accumulo.core.data.Key("", "", "cq only"); Assert.assertFalse("cq only key should not be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey, cbKey))); cbKey = new org.apache.accumulo.core.data.Key("row", "", "and cq"); Assert.assertFalse("row and cq only key should not be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey, cbKey))); cbKey = new org.apache.accumulo.core.data.Key("row", "and a cf"); Assert.assertTrue("row and cf only key should be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey, cbKey))); org.apache.accumulo.core.data.Key cbKey1 = new org.apache.accumulo.core.data.Key("row", "and a cf"); org.apache.accumulo.core.data.Key cbKey2 = new org.apache.accumulo.core.data.Key("row", "and another cf"); Assert.assertFalse("different keys should not be in bloom filter", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey1, cbKey2))); cbKey1 = new org.apache.accumulo.core.data.Key("row", "and a cf", "and a cq"); cbKey2 = cbKey1.followingKey(PartialKey.ROW_COLFAM); Assert.assertFalse("consecutive keys should not be in bloom filter with end inclusive", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey1, cbKey2))); Assert.assertTrue("consecutive keys should be in bloom filter with end exclusive", ShardIndexKeyFunctor.isRangeInBloomFilter(new Range(cbKey1, true, cbKey2, false))); }