@Test public void testGetMostRecentEvent() { EventManager manager = new EventManagerImpl(2); Event e1 = new Event("1", "Event1", Category.INFO, 0); Event e2 = new Event("1", "Event2", Category.INFO, 1); manager.addEvent(e1); manager.addEvent(e2); // assert newest to oldest assertEquals(e2, manager.getMostRecentEvent("1")); }
@Test public void testGetMostRecentEventUnknownSource() { EventManager manager = new EventManagerImpl(1); assertNull(manager.getMostRecentEvent("unknown value")); }