@Test public void testClear() throws Exception { SimulationEvent event1 = new SimulationEvent.Builder("any type").simulationTime(1).build(); EventCalendar calendar = new SimpleEventCalendar(clock, comparator); calendar.addEvent(event1); calendar.clear(); assertTrue(calendar.isEmpty()); assertNull(calendar.removeFirstEvent()); }
@Override public void clear() { eventList.clear(); minIndex = NULL; }
SimpleEventCalendar implements EventCalendar { @Override public void clear() { eventList.clear(); minIndex = NULL; } }
SimpleEventCalendar implements EventCalendar { @Override public void clear() { eventList.clear(); minIndex = NULL; } SimpleEventCalendar(ClockReader clockReader, Comparator<SimulationEvent> eventComparator); }
SimpleEventCalendar implements EventCalendar { @Override public void clear() { eventList.clear(); minIndex = NULL; } SimpleEventCalendar(ClockReader clockReader, Comparator<SimulationEvent> eventComparator); @Override boolean isEmpty(); @Override SimulationEvent peekFirstEvent(); @Override SimulationEvent removeFirstEvent(); @Override List<SimulationEvent> getEvents(); @Override void addEvent(SimulationEvent event); @Override void clear(); void addEvents(Collection<SimulationEvent> simulationEvents); }
SimpleEventCalendar implements EventCalendar { @Override public void clear() { eventList.clear(); minIndex = NULL; } SimpleEventCalendar(ClockReader clockReader, Comparator<SimulationEvent> eventComparator); @Override boolean isEmpty(); @Override SimulationEvent peekFirstEvent(); @Override SimulationEvent removeFirstEvent(); @Override List<SimulationEvent> getEvents(); @Override void addEvent(SimulationEvent event); @Override void clear(); void addEvents(Collection<SimulationEvent> simulationEvents);  }