### Question:
ESClient extends SearchClient { @Override public IdGrabber getIdGrabber(ArrayBlockingQueue<Set<String>> ids, int batchSize, int copierThreads, Collection<Query> filterQueries) throws IOException, SearchClientException { return new ESIdGrabber(getDefaultIdField(), ids, batchSize, copierThreads, filterQueries); } ESClient(String url); @Override SearchResultSet search(QueryRequest query); @Override FacetResult facet(QueryRequest query); @Override void addDocuments(List<StoredDocument> documents); @Override List<StoredDocument> getDocs(String idField, Set<String> ids,
                                        Set<String> whiteListFields,
                                        Set<String> blackListFields); @Override Collection<? extends String> getCopyFields(); @Override String getDefaultIdField(); @Override void deleteAll(); @Override IdGrabber getIdGrabber(ArrayBlockingQueue<Set<String>> ids,
                                  int batchSize,
                                  int copierThreads,
                                  Collection<Query> filterQueries); @Override Set<String> getSystemInternalFields(); @Override List<String> analyze(String field, String string); @Override List<TokenDF> getTerms(String field, String lower,
                                  int limit, int minCount);  }### Answer:
@Test public void testIDGrabbing() throws Exception { SearchClient searchClient = SearchClientFactory.getClient(TMDB_URL); final ArrayBlockingQueue<Set<String>> ids = new ArrayBlockingQueue<>(10); IdGrabber grabber = searchClient.getIdGrabber(ids, 1000, 1, Collections.EMPTY_SET); Thread producer = new Thread(new FutureTask(grabber)); producer.start(); final AtomicInteger idCounter = new AtomicInteger(0); Thread consumer = new Thread() { @Override public void run() { while (true) { Set<String> set = null; try { set = ids.poll(1, TimeUnit.SECONDS); } catch (InterruptedException e) { } if (set != null) { idCounter.addAndGet(set.size()); } if (set != null && set.size() == 0) { break; } } } }; consumer.start(); producer.join(); consumer.join(); assertEquals(27846, idCounter.get()); }