### Question:
MapReduceSolrInputDocumentWriter implements SolrInputDocumentWriter { @Override public void add(int shard, Map<String, SolrInputDocument> inputDocumentMap) throws SolrServerException, IOException { for (Entry<String, SolrInputDocument> documentEntry : inputDocumentMap.entrySet()) { try { context.write( new Text(documentEntry.getKey()), new SolrInputDocumentWritable(documentEntry.getValue())); context.getCounter(HBaseIndexerCounters.OUTPUT_INDEX_DOCUMENTS).increment(1L); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } } } MapReduceSolrInputDocumentWriter(Context context); @Override void add(int shard, Map<String, SolrInputDocument> inputDocumentMap); @Override void deleteById(int shard, List<String> idsToDelete); @Override void deleteByQuery(String deleteQuery); @Override void close();  }### Answer:
@Test public void testAdd() throws SolrServerException, IOException, InterruptedException { SolrInputDocument solrInputDoc = mock(SolrInputDocument.class); mrWriter.add(-1, ImmutableMap.of("docId", solrInputDoc)); ArgumentCaptor<SolrInputDocumentWritable> docWritableCaptor = ArgumentCaptor.forClass(SolrInputDocumentWritable.class); verify(context).write(eq(new Text("docId")), docWritableCaptor.capture()); assertSame(solrInputDoc, docWritableCaptor.getValue().getSolrInputDocument()); }