DaySelectionModel extends AbstractDateSelectionModel { @Override public void removeSelectionInterval(Date startDate, Date endDate) { if (startDate.after(endDate)) { return; } startDate = startOfDay(startDate); endDate = startOfDay(endDate); long startDateMs = startDate.getTime(); long endDateMs = endDate.getTime(); ArrayList<Date> datesToRemove = new ArrayList<Date>(); for (Date selectedDate : selectedDates) { long selectedDateMs = selectedDate.getTime(); if (selectedDateMs >= startDateMs && selectedDateMs <= endDateMs) { datesToRemove.add(selectedDate); } } if (!datesToRemove.isEmpty()) { selectedDates.removeAll(datesToRemove); fireValueChanged(EventType.DATES_REMOVED); } } DaySelectionModel();  DaySelectionModel(Locale locale); @Override SelectionMode getSelectionMode(); @Override void setSelectionMode(final SelectionMode selectionMode); @Override void addSelectionInterval(Date startDate, Date endDate); @Override void setSelectionInterval(Date startDate, Date endDate); @Override void removeSelectionInterval(Date startDate, Date endDate); @Override void clearSelection(); @Override SortedSet<Date> getSelection(); @Override Date getFirstSelectionDate(); @Override Date getLastSelectionDate(); @Override boolean isSelected(Date date); @Override boolean isSelectionEmpty(); @Override SortedSet<Date> getUnselectableDates(); @Override void setUnselectableDates(SortedSet<Date> unselectables); @Override boolean isUnselectableDate(Date date); @Override Date getNormalizedDate(Date date);  }
@Test public void testRemoveIntervalNulls() { try { model.removeSelectionInterval(null, null); fail("normalizedDate must throw NPE if date is null"); } catch (NullPointerException e) { } catch (Exception e) { fail("unexpected exception " + e); } }