@Test
public void testEviction() throws Exception {

    HashMap<String, Object> data = new HashMap<>();
    data.put("first", 1);
    Event event = new Event("collected", data);
    alertingService.store(event);
    data = new HashMap<>();
    data.put("second", 2);
    data.put("alertRule", "test");
    event = new Event("collected", data);
    alertingService.store(event);
    Assert.assertEquals(2, alertingService.list().size());
    alertingService.eviction();
    Assert.assertEquals(1, alertingService.list().size());
}