LabeledTableModel extends AbstractTableModel { @Override public final int getColumnCount() { if (orientation == TableOrientation.ROW_MAJOR) { return getAttributeCount(); } else { return getObjectCount(); } } LabeledTableModel(TableLabelingAlgorithm algorithm, TableOrientation orientation); void addLabelChangeListener(LabelChangeListener listener); void removeLabelChangeListener(LabelChangeListener listener); TableType getTableType(); @Override final int getRowCount(); @Override final int getColumnCount(); @Override final Object getValueAt(int rowIndex, int columnIndex); final Object getStoredValueAt(int rowIndex, int columnIndex); TableOrientation getOrientation(); void setOrientation(TableOrientation newOrientation); void fireLabelsChanged(); @Override void fireTableCellUpdated(int row, int column); void updateLabels(); boolean hasRowLabels(); boolean hasColumnLabels(); String getRowName(int rowIndex); String getFullRowName(int rowIndex); @Override String getColumnName(int columnIndex); String getFullColumnName(int columnIndex); String getCellName(int rowIndex, int columnIndex); final String getFullCellName(int rowIndex, int columnIndex); ListModel getRowLabelModel(); ListModel getColumnLabelModel(); final String getIdentifierAt(int rowIndex, int columnIndex); final boolean canSetValueAt(int rowIndex, int columnIndex, boolean isInsertRow, boolean isInsertColumn); final void setValueAt(Object aValue, int rowIndex, int columnIndex, boolean isInsertRow, boolean isInsertColumn); abstract boolean isSkeleton();  }
@Test public void testGetColumnCount() { assertEquals(model.getColumnCount(), values[0].length); model.setOrientation(TableOrientation.COLUMN_MAJOR); assertEquals(model.getColumnCount(), values.length); }