@Test
public void testUpdateAllComponentTreeUIs() {

    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    if (isCrossPlatformLFSameAsSystem()) {
        LOG.info("cannot run test - no safe LFs to toggle");
        return;
    }
    List<RootPaneContainer> toplevels = new ArrayList<RootPaneContainer>();
    for (int i = 0; i < 10; i++) {
        JXFrame frame = new JXFrame();
        toplevels.add(frame);
        toplevels.add(new JDialog(frame));
        toplevels.add(new JWindow(frame));
    }
    // sanity
    if (!UIManager.getLookAndFeel().isNativeLookAndFeel()) {
        LOG.warning("Assumption is to start with native LaF. Found " + UIManager.getLookAndFeel() + " instead.");
    }
    setSystemLF(false);
    SwingXUtilities.updateAllComponentTreeUIs();
    // sanity
    for (RootPaneContainer window : toplevels) {
        JRootPane rootPane = window.getRootPane();
        assertEquals(UIManager.get(rootPane.getUIClassID()),  
                rootPane.getUI().getClass().getName());
    }
}