@Test
public void testPrefSizeEmptyEditor() {

    JXDatePicker picker = new JXDatePicker(new Date());
    Dimension withValue = picker.getPreferredSize();
    // null value
    picker.setDate(null);
    assertEquals("pref width must be same null value", 
            withValue.width, picker.getPreferredSize().width);
}