### Question:
BufferedSolrInputDocumentWriter implements SolrInputDocumentWriter { @Override public void close() throws SolrServerException, IOException { flush(); delegateWriter.close(); } BufferedSolrInputDocumentWriter(SolrInputDocumentWriter delegateWriter, int bufferSize,
            Counter documentOutputCounter, Counter documentBatchOutputCounter); @Override void add(int shard, Map<String, SolrInputDocument> inputDocumentMap); @Override void deleteById(int shard, List<String> idsToDelete); @Override void deleteByQuery(String deleteQuery); void flush(); @Override void close();  }### Answer:
@Test public void testClose() throws SolrServerException, IOException { SolrInputDocument doc = mock(SolrInputDocument.class); bufferedWriter.add(-1, ImmutableMap.of("a", doc)); bufferedWriter.close(); verify(delegateWriter).add(eq(-1), eq(ImmutableMap.of("a", doc))); verify(delegateWriter).close(); verify(docCounter).increment(1L); }