@Test
public void testGetTrendingTopics() throws Exception {

    DateTimeFormatter dtf = DateTimeUtils.PARAMETER_WITH_DAY_DTF.withZone(dtZone);
    String startTimeStr = dtf.print(mentionTime.minusDays(1));
    String endTimeStr = dtf.print(mentionTime.plusDays(1));
    Map<String, Long> response = underTest.getTrendingTopics(startTimeStr, endTimeStr,
                                                             ImmutableList.of("u1"),
                                                             ImmutableList.of("r1"),
                                                             null, null);
    Map<String, Long> expected = Maps.newHashMap();
    expected.put("e1", 5L);
    expected.put("e2", 1L);
    assertEquals(expected, response);
    response = underTest.getTrendingTopics(startTimeStr, endTimeStr, ImmutableList.of("u1"),
                                           null, null, null);
    expected.clear();
    expected.put("e1", 5L);
    expected.put("e4", 3L);
    expected.put("e2", 1L);
    assertEquals(expected, response);
    response = underTest.getTrendingTopics(startTimeStr, endTimeStr, null, null, null, null);
    expected.clear();
    expected.put("e2", 14L);
    expected.put("e1", 11L);
    expected.put("e3", 6L);
    expected.put("e4", 3L);
    assertEquals(expected, response);
}