@Test
public void testRelease() throws InterruptedException, InvocationTargetException {

    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    JXDatePicker picker = getRealizedDatePicker();
    Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
    assertFalse("sanity: initial focus must not be in picker", 
            SwingXUtilities.isDescendingFrom(focusOwner, picker));
    CompoundFocusListener l = new CompoundFocusListener(picker);
    final PropertyChangeReport report = new PropertyChangeReport();
    l.addPropertyChangeListener(report);
    l.release();
    picker.requestFocusInWindow();
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
            assertEquals(0, report.getEventCount("focused"));
        }
    });
}