@Test
public void testSetDate() {

    calendar.setTimeInMillis(System.currentTimeMillis());
    calendar.add(Calendar.DAY_OF_MONTH, 5);
    Date expectedDate = cleanupDate(calendar);
    JXDatePicker datePicker = new JXDatePicker();
    datePicker.setDate(calendar.getTime());
    assertTrue(expectedDate.equals(datePicker.getDate()));
    assertTrue(expectedDate.equals(datePicker.getEditor().getValue()));
    datePicker.setDate(null);
    assertTrue(null == datePicker.getDate());
    assertTrue(null == datePicker.getEditor().getValue());
}