DefaultDateSelectionModel extends AbstractDateSelectionModel { @Override public void setSelectionInterval(final Date startDate, Date endDate) { if (SelectionMode.SINGLE_SELECTION.equals(selectionMode)) { if (isSelected(startDate)) return; endDate = startDate; } else { if (isIntervalSelected(startDate, endDate)) return; } clearSelectionImpl(); if (addSelectionImpl(startDate, endDate)) { fireValueChanged(EventType.DATES_SET); } } DefaultDateSelectionModel();  DefaultDateSelectionModel(Locale locale); @Override SelectionMode getSelectionMode(); @Override void setSelectionMode(final SelectionMode selectionMode); @Override void addSelectionInterval(Date startDate, Date endDate); @Override void setSelectionInterval(final Date startDate, Date endDate); @Override void removeSelectionInterval(final Date startDate, final Date endDate); @Override void clearSelection(); @Override SortedSet<Date> getSelection(); @Override Date getFirstSelectionDate(); @Override Date getLastSelectionDate(); @Override boolean isSelected(final Date date); @Override Date getNormalizedDate(Date date); @Override boolean isSelectionEmpty(); @Override SortedSet<Date> getUnselectableDates(); @Override void setUnselectableDates(SortedSet<Date> unselectableDates); @Override boolean isUnselectableDate(Date date);  }
@Test public void testSetIntervalNulls() { try { model.setSelectionInterval(null, null); fail("normalizedDate must throw NPE if date is null"); } catch (NullPointerException e) { } catch (Exception e) { fail("unexpected exception " + e); } }