### Question:
SearchService { protected static FilterBuilder[] filtersMapToArrayExcluding(Map<String, FilterBuilder> filters, String filterToExclude) { List<FilterBuilder> builders = new ArrayList<>(); if (filters != null) { for (String name : filters.keySet()) { if (filterToExclude == null || !filterToExclude.equals(name)) { builders.add(filters.get(name)); } } } return builders.toArray(new FilterBuilder[builders.size()]); }  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 getFilters() { { FilterBuilder[] ret = SearchService.filtersMapToArrayExcluding(null, null); Assert.assertNotNull(ret); Assert.assertEquals(0, ret.length); } { FilterBuilder[] ret = SearchService.filtersMapToArrayExcluding(null, "aaa"); Assert.assertNotNull(ret); Assert.assertEquals(0, ret.length); } Map<String, FilterBuilder> filters = new LinkedHashMap<>(); FilterBuilder fb1 = Mockito.mock(FilterBuilder.class); filters.put("f1", fb1); FilterBuilder fb2 = Mockito.mock(FilterBuilder.class); filters.put("f2", fb2); FilterBuilder fb3 = Mockito.mock(FilterBuilder.class); filters.put("f3", fb3); { FilterBuilder[] ret = SearchService.filtersMapToArrayExcluding(filters, null); Assert.assertNotNull(ret); Assert.assertEquals(3, ret.length); Assert.assertEquals(fb1, ret[0]); Assert.assertEquals(fb2, ret[1]); Assert.assertEquals(fb3, ret[2]); } { FilterBuilder[] ret = SearchService.filtersMapToArrayExcluding(filters, "f2"); Assert.assertNotNull(ret); Assert.assertEquals(2, ret.length); Assert.assertEquals(fb1, ret[0]); Assert.assertEquals(fb3, ret[1]); } }