ScheduleList { public void clear() { obtainWriteLock(); dataset.clear(); positionForId.clear(); callback.onCleared(); releaseWriteLock(); } ScheduleList(ItemChangeCallback callback); int size(); void swapData(Iterable<ScheduleItem> newDataSet); ScheduleItem get(int position); ScheduleItem getById(long scheduleId); void clear();  }
@Test public void testClear() throws Exception { scheduleList.clear(); assertEquals(0, scheduleList.size()); verify(itemChangeCallback).onCleared(); verifyNoMoreInteractions(itemChangeCallback); }