@Test
public void testAdd() {

    SolrInputDocumentBuilder builder = new SolrInputDocumentBuilder();
    
    SolrInputDocument docA = new SolrInputDocument();
    SolrInputDocument docB = new SolrInputDocument();
    
    docA.addField("fieldA", "valueA1");
    docA.addField("fieldA", "valueA2");
    docB.addField("fieldB", "valueB");
    
    builder.add(docA);
    builder.add(docB);
    
    SolrInputDocument merged = builder.getDocument();
    
    assertEquals(Sets.newHashSet("fieldA", "fieldB"), merged.keySet());
    
    assertEquals(Lists.newArrayList("valueA1", "valueA2"), merged.getField("fieldA").getValues());
    assertEquals(Lists.newArrayList("valueB"), merged.getField("fieldB").getValues());
}