### Question:
SearchService { public Map<String, String> getIntervalValuesForDateHistogramAggregations(QuerySettings querySettings) { Map<String, String> ret = new HashMap<>(); Set<String> aggregations = querySettings.getAggregations(); if (aggregations != null && !aggregations.isEmpty()) { Map<String, String> dateHistogramAggregations = filterAggregationNamesUsingDateHistogramAggregationType(aggregations); for (String aggregationName : dateHistogramAggregations.keySet()) { String interval = getDateHistogramAggregationInterval(dateHistogramAggregations.get(aggregationName)); if (interval != null) { ret.put(aggregationName + "_interval", interval); } } } return ret; }  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 getSearchResponseAdditionalFields() throws ReflectiveOperationException { ConfigService configService = mockConfigurationService(); SearchService tested = getTested(configService); try { tested.getIntervalValuesForDateHistogramAggregations(null); Assert.fail("NullPointerException expected"); } catch (NullPointerException e) { } QuerySettings qs = new QuerySettings(); Map<String, String> ret = tested.getIntervalValuesForDateHistogramAggregations(qs); Assert.assertTrue(ret.isEmpty()); qs.addAggregation("activity_dates_histogram"); qs.getFiltersInit().acknowledgeUrlFilterCandidate("activity_date_interval", PastIntervalValue.QUARTER.toString()); tested.parsedFilterConfigService.prepareFiltersForRequest(qs.getFilters()); ret = tested.getIntervalValuesForDateHistogramAggregations(qs); Assert.assertEquals(1, ret.size()); Assert.assertEquals("week", ret.get("activity_dates_histogram_interval")); }