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

    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run ui test - headless environment");
        return;
    }
    
    final JXList list = new JXList(AncientSwingTeam.createNamedColorListModel(), true);
    showWithScrollingInFrame(list, "");
    final Dimension size = list.getSize();
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            RowFilter<? super ListModel, ? super Integer> filter = RowFilters.regexFilter(Pattern.CASE_INSENSITIVE, "^b");
            list.setRowFilter(filter);
        }
    });
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            // subtraction arbitrary number, don't want to depend on single pixels
            assertTrue("height must be adjusted to reduced number of rows, " +
            		"but was (old/current): " + size.height + "/" + list.getSize().height, 
            		size.height - 50 > list.getSize().height);
        }
    });
}