### Question:
ShardKeyFunctor implements KeyFunctor { static boolean isKeyInBloomFilter(org.apache.accumulo.core.data.Key cbKey) { byte[] cf = cbKey.getColumnFamilyData().getBackingArray(); return (cf.length > 3 && cf[0] == FIELD_INDEX_PREFIX[0] && cf[1] == FIELD_INDEX_PREFIX[1] && cf[2] == FIELD_INDEX_PREFIX[2] && cbKey .getColumnQualifierData().length() > 0); }  @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 testIsKeyInBloomFilter() { org.apache.accumulo.core.data.Key cbKey = new org.apache.accumulo.core.data.Key(); Assert.assertFalse("empty key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("row only", "fi\0"); Assert.assertFalse("row only key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("", "fi\0cf only"); Assert.assertFalse("cf only key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("", "fi\0", "cq only"); Assert.assertFalse("cq only key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("row", "fi\0", "and cq"); Assert.assertFalse("row and cq only key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("row", "fi\0and cf"); Assert.assertFalse("row and cf only key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("row", "and cf", "and a cq"); Assert.assertFalse("row and cf (non-fi) and cq key should not be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("row", "fi\0and cf", "and a cq"); Assert.assertTrue("row and cf and cq key should be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); cbKey = new org.apache.accumulo.core.data.Key("", "fi\0and cf", "and a cq"); Assert.assertTrue("cf and cq key should be in bloom filter", ShardKeyFunctor.isKeyInBloomFilter(cbKey)); }