### Question:
DefaultResultToSolrMapper implements ResultToSolrMapper { @Override public boolean isRelevantKV(KeyValue kv) { for (ByteArrayExtractor extractor : extractors) { if (extractor.isApplicable(kv)) { return true; } } return false; } DefaultResultToSolrMapper(String indexerName, List<FieldDefinition> fieldDefinitions,
            List<DocumentExtractDefinition> documentExtractDefinitions); @Override boolean containsRequiredData(Result result); @Override boolean isRelevantKV(KeyValue kv); @Override Get getGet(byte[] row); @Override void map(Result result, SolrUpdateWriter solrUpdateWriter);  }### Answer:
@Test public void testIsRelevantKV_WithoutWildcards() { FieldDefinition fieldDef = new FieldDefinition("fieldA", "cf:qualifier", ValueSource.VALUE, "int"); DefaultResultToSolrMapper resultMapper = new DefaultResultToSolrMapper("index-name", Lists.newArrayList(fieldDef), Collections.<DocumentExtractDefinition> emptyList()); KeyValue relevantKV = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("cf"), Bytes.toBytes("qualifier"), Bytes.toBytes("value")); KeyValue notRelevantKV_WrongFamily = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("wrongcf"), Bytes.toBytes("qualifier"), Bytes.toBytes("value")); KeyValue notRelevantKV_WrongQualifier = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("cf"), Bytes.toBytes("wrongqualifier"), Bytes.toBytes("value")); assertTrue(resultMapper.isRelevantKV(relevantKV)); assertFalse(resultMapper.isRelevantKV(notRelevantKV_WrongFamily)); assertFalse(resultMapper.isRelevantKV(notRelevantKV_WrongQualifier)); }
@Test public void testIsRelevantKV_WithWildcards() { FieldDefinition fieldDef = new FieldDefinition("fieldA", "cf:quali*", ValueSource.VALUE, "int"); DefaultResultToSolrMapper resultMapper = new DefaultResultToSolrMapper("index-name", Lists.newArrayList(fieldDef), Collections.<DocumentExtractDefinition> emptyList()); KeyValue relevantKV = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("cf"), Bytes.toBytes("qualifier"), Bytes.toBytes("value")); KeyValue notRelevantKV_WrongFamily = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("wrongcf"), Bytes.toBytes("qualifier"), Bytes.toBytes("value")); KeyValue notRelevantKV_WrongQualifier = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("cf"), Bytes.toBytes("qu wrong qualifier"), Bytes.toBytes("value")); assertTrue(resultMapper.isRelevantKV(relevantKV)); assertFalse(resultMapper.isRelevantKV(notRelevantKV_WrongFamily)); assertFalse(resultMapper.isRelevantKV(notRelevantKV_WrongQualifier)); }