TableUtilities { public static void clear(TableColumnModel model, boolean includeHidden) { if (model instanceof TableColumnModelExt) { clear(model, ((TableColumnModelExt) model).getColumns(includeHidden)); } else { clear(model, Collections.list(model.getColumns())); } } private  TableUtilities(); static boolean isDataChanged(TableModelEvent e); static boolean isUpdate(TableModelEvent e); static boolean isInsert(TableModelEvent e); static boolean isDelete(TableModelEvent e); static boolean isStructureChanged(TableModelEvent e); static int getPreferredRowHeight(JTable table, int row); static void setPreferredRowHeight(JTable table, int row); static void setPreferredRowHeights(JTable table); static int[] ordinalsOf(Enum<?>... values); static void clear(TableColumnModel model, boolean includeHidden);  }
@Test public void testRemoveAllColumns() { TableColumnModel model = createTableColumnModel(); TableUtilities.clear(model, true); assertEquals(0, model.getColumnCount()); }
@Test public void testRemoveAllColumnsExt() { TableColumnModelExt model = createTableColumnModelExt(); TableUtilities.clear(model, true); assertEquals(0, model.getColumnCount()); }
@Test public void testRemoveAllColumnsExtHiddenIncluded() { TableColumnModelExt model = createTableColumnModelExt(); model.getColumnExt(0).setVisible(false); TableUtilities.clear(model, true); assertEquals(0, model.getColumnCount(true)); }
@Test public void testRemoveAllColumnsExtHiddenExcluded() { TableColumnModelExt model = createTableColumnModelExt(); model.getColumnExt(0).setVisible(false); TableUtilities.clear(model, false); assertEquals(1, model.getColumnCount(true)); }