ColumnFactory { public TableColumnExt createTableColumn(int modelIndex) { return new TableColumnExt(modelIndex); }  static synchronized ColumnFactory getInstance(); static synchronized void setInstance(ColumnFactory factory); TableColumnExt createAndConfigureTableColumn(TableModel model, int modelIndex); TableColumnExt createTableColumn(int modelIndex); void configureTableColumn(TableModel model, TableColumnExt columnExt); void configureColumnWidths(JXTable table, TableColumnExt columnExt); int getPreferredScrollableViewportWidth(JXTable table); void packColumn(JXTable table, TableColumnExt columnExt, int margin,
            int max); int getDefaultPackMargin(); void setDefaultPackMargin(int margin);  }
@Test public void testTableCopeWithCreateNullColumn() { ColumnFactory factory = new ColumnFactory() { @Override public TableColumnExt createTableColumn(int modelIndex) { return modelIndex > 0 ? super.createTableColumn(modelIndex) : null; } }; JXTable table = new JXTable(); table.setColumnFactory(factory); TableModel model = new DefaultTableModel(0, 10); table.setModel(model); assertEquals("factory must have created one less than model columns", model.getColumnCount() - 1, table.getColumnCount()); }