@Test
public void testUpdateUI() throws Exception {

    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    
    final boolean[] updated = new boolean[] {false, false};
    
    SearchFactory.setInstance(new SearchFactory() {
        /**
         * {@inheritDoc}
         */
        @Override
        public JXFindBar createFindBar() {
            return new JXFindBar() {
                /**
                 * {@inheritDoc}
                 */
                @Override
                public void updateUI() {
                    updated[0] = true;
                    super.updateUI();
                }
            };
        }
        /**
         * {@inheritDoc}
         */
        @Override
        public JXFindPanel createFindPanel() {
            return new JXFindPanel() {
                /**
                 * {@inheritDoc}
                 */
                @Override
                public void updateUI() {
                    updated[1] = true;
                    super.updateUI();
                }
            };
        }
    });
    
    JXFindBar bar = SearchFactory.getInstance().getSharedFindBar();
    JXFindPanel panel = SearchFactory.getInstance().getSharedFindPanel();
    
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    
    assertThat(bar, is(sameInstance(SearchFactory.getInstance().getSharedFindBar())));
    assertThat(updated[0], is(true));
    assertThat(panel, is(sameInstance(SearchFactory.getInstance().getSharedFindPanel())));
    assertThat(updated[1], is(true));
}