SnapshotTableModel extends AbstractTableModel { @Override public String getColumnName(int column) { return column == 0 ? "Name" : "Value"; } SnapshotTableModel(Object[][] objects); @Override int getRowCount(); @Override int getColumnCount(); @Override String getColumnName(int column); @Override Class<?> getColumnClass(int columnIndex); @Override Object getValueAt(int rowIndex, int columnIndex);  }
@Test public void testGetColumnName() { assertEquals("Name", tableModel.getColumnName(0)); assertEquals("Value", tableModel.getColumnName(1)); }