### Question:
SolrClient extends SearchClient { @Override public List<TokenDF> getTerms(String field, String lower, int limit, int minCount) throws IOException, SearchClientException { StringBuilder request = new StringBuilder(); request.append(url).append("/terms?terms=true"); request.append("&terms.fl=").append(encode(field)); request.append("&limit=" + limit); if (!StringUtils.isBlank(lower)) { request.append("&terms.lower=").append(encode(lower)); } if (minCount > 0) { request.append("&terms.mincount=" + minCount); } request.append("&terms.lower.incl=false"); request.append("&terms.sort=index"); request.append(JSON_RESPONSE); JsonResponse jsonResponse = getJson(request.toString()); if (jsonResponse.getStatus() != 200) { throw new SearchClientException(jsonResponse.getMsg()); } List<TokenDF> termDFList = new ArrayList<>(); JsonObject termObj = jsonResponse.getJson().getAsJsonObject() .getAsJsonObject("terms"); JsonArray fieldArr = termObj.getAsJsonArray(field); for (int i = 0; i < fieldArr.size(); i += 2) { termDFList.add(new TokenDF( fieldArr.get(i).getAsString(), fieldArr.get(i + 1).getAsLong() )); } return termDFList; } protected  SolrClient(String url); @Override SearchResultSet search(QueryRequest query); @Override FacetResult facet(QueryRequest query); @Override void addDocuments(List<StoredDocument> buildDocuments); @Override List<StoredDocument> getDocs(String idField, Set<String> ids,
                                        Set<String> whiteListFields,
                                        Set<String> blackListFields); @Override Set<String> getCopyFields(); @Override synchronized 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 testTerms() throws Exception { SearchClient client = SearchClientFactory.getClient(TMDB_URL); String lower = ""; Set<TokenDF> allTerms = new HashSet<>(); while (true) { List<TokenDF> terms = client.getTerms("production_companies_facet", lower, 100, 0); if (terms.size() == 0) { break; } lower = terms.get(terms.size() - 1).getToken(); allTerms.addAll(terms); } assertEquals(15904, allTerms.size()); boolean found = false; for (TokenDF tdf : allTerms) { if (tdf.getToken().equals("13 productions")) { assertEquals(3l, tdf.getDf()); found = true; } } assertTrue(found); allTerms = new HashSet<>(); lower = ""; while (true) { List<TokenDF> terms = client.getTerms("production_companies_facet_lc", lower, 100, 0); if (terms.size() == 0) { break; } lower = terms.get(terms.size() - 1).getToken(); allTerms.addAll(terms); } assertEquals(15938, allTerms.size()); }