@Test
public void testExtractDocument() {

    byte[] bytesA = new byte[] { 1, 2 };
    byte[] bytesB = new byte[] { 3, 4 };
    Result result = mock(Result.class);
    when(valueExtractor.extract(result)).thenReturn(Lists.newArrayList(bytesA, bytesB));
    doReturn(Lists.newArrayList("A")).when(valueMapper).map(bytesA);
    doReturn(Lists.newArrayList("B")).when(valueMapper).map(bytesB);
    
    SolrInputDocument solrDocument = new SolrInputDocument();
    documentExtractor.extractDocument(result, solrDocument);
    
    assertEquals(Sets.newHashSet("fieldName"), solrDocument.keySet());
    assertEquals(Lists.newArrayList("A", "B"), solrDocument.get("fieldName").getValues());
}