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

    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    final JXDatePicker picker = getRealizedDatePicker();
    picker.requestFocusInWindow();
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
            Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
            assertTrue("sanity: focus transfered into picker hierarchy", 
                    SwingXUtilities.isDescendingFrom(focusOwner, picker));
            CompoundFocusListener l = new CompoundFocusListener(picker);
            assertTrue("listener must take initial focused state ", l.isFocused());
        }
    });
}