### Question:
ESClient extends SearchClient { @Override public Collection<? extends String> getCopyFields() throws IOException, SearchClientException { JsonResponse response = getJson(esBase + "_template/" + esCollection); if (response.getStatus() != 200) { throw new SearchClientException(response.getMsg()); } JsonElement root = response.getJson(); if (!root.isJsonObject()) { return Collections.EMPTY_SET; } JsonElement collectionRoot = root.getAsJsonObject().get(esCollection); if (!collectionRoot.isJsonObject()) { return Collections.EMPTY_SET; } JsonObject mappings = (JsonObject) collectionRoot.getAsJsonObject().get("mappings"); Set<String> destFields = new HashSet<>(); addValuesForKey(mappings, "copy_to", destFields); return destFields; } 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 testCopyFields() throws Exception { ESClient client = new ESClient("http: Collection copyFields = client.getCopyFields(); Set<String> set = new HashSet<>(copyFields); assertTrue(set.contains("people")); }