@Test
public void testGetTotalMentionsForType() {

    DateTime end = DateTime.now();
    DateTime start = end.minusDays(1);
    Interval interval = new Interval(start, end);
    underTest.persistValue(new EmojiEntity("u1", "r1", start, "a", 1, true));
    underTest.persistValue(new EmojiEntity("u1", "r2", start.plusMillis(1), "a", 1, false));
    underTest.persistValue(new EmojiEntity("u2", "r3", start.plusMillis(2), "a", 1, false));
    underTest.persistValue(new EmojiEntity("u1", "r2", start.plusMillis(3), "b", 1, false));
    underTest.persistValue(new EmojiEntity("u1", "r3", start.plusMillis(5), "c", 1, false));
    int result = underTest.getTotalMentionsForType("a", interval, ImmutableList.of(),
                                                   ImmutableList.of(), true);
    assertEquals(3, result);
    result = underTest.getTotalMentionsForType("a", interval, ImmutableList.of("r1"),
                                               ImmutableList.of(), true);
    assertEquals(1, result);
    result = underTest.getTotalMentionsForType("a", interval, ImmutableList.of("r1", "r2"),
                                               ImmutableList.of(), true);
    assertEquals(2, result);
    result = underTest.getTotalMentionsForType("a", interval, ImmutableList.of(),
                                               ImmutableList.of("u1"), true);
    assertEquals(2, result);
    result = underTest.getTotalMentionsForType("a", interval, ImmutableList.of(),
                                               ImmutableList.of("u1", "u2"), true);
    assertEquals(3, result);
    result = underTest.getTotalMentionsForType("a", interval, ImmutableList.of(),
                                               ImmutableList.of(), false);
    assertEquals(2, result);
}