### Question:
SearchService { protected static String prepareIndexNamesCacheKey(Set<String> sysTypesRequested, boolean isSysTypeAggregation) { if (sysTypesRequested == null || sysTypesRequested.isEmpty()) return "_all||" + isSysTypeAggregation; if (sysTypesRequested.size() == 1) { return sysTypesRequested.iterator().next() + "||" + isSysTypeAggregation; } List<String> ordered = new ArrayList<>(sysTypesRequested); Collections.sort(ordered); StringBuilder sb = new StringBuilder(); for (String k : ordered) { sb.append(k).append("|"); } sb.append("|").append(isSysTypeAggregation); return sb.toString(); }  SearchResponse performSearch(QuerySettings querySettings, String responseUuid, StatsRecordType statsRecordType); Map<String, String> getIntervalValuesForDateHistogramAggregations(QuerySettings querySettings); boolean writeSearchHitUsedStatisticsRecord(String uuid, String contentId, String sessionId); SearchResponse performSearchTemplate(final String templateName, final Map<String, Object> templateParams,
												final QuerySettings.Filters filters); static final String CFGNAME_FIELD_VISIBLE_FOR_ROLES; static final String CFGNAME_SOURCE_FILTERING_FOR_ROLES; static final int RESPONSE_MAX_SIZE; }### Answer:
@Test public void prepareIndexNamesCacheKey() { Assert.assertEquals("_all||false", SearchService.prepareIndexNamesCacheKey(null, false)); Assert.assertEquals("_all||true", SearchService.prepareIndexNamesCacheKey(null, true)); Set<String> sysTypesRequested = new HashSet<>(); Assert.assertEquals("_all||false", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, false)); Assert.assertEquals("_all||true", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, true)); sysTypesRequested.add("aaaa"); Assert.assertEquals("aaaa||true", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, true)); Assert.assertEquals("aaaa||false", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, false)); sysTypesRequested.add("bb"); Assert.assertEquals("aaaa|bb||true", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, true)); Assert.assertEquals("aaaa|bb||false", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, false)); sysTypesRequested = new HashSet<>(); sysTypesRequested.add("bb"); sysTypesRequested.add("zzzzz"); sysTypesRequested.add("aaaa"); Assert.assertEquals("aaaa|bb|zzzzz||true", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, true)); Assert.assertEquals("aaaa|bb|zzzzz||false", SearchService.prepareIndexNamesCacheKey(sysTypesRequested, false)); }