SnapshotTableModel extends AbstractTableModel { @Override public Class<?> getColumnClass(int columnIndex) { return String.class; } 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 testGetColumnClass() { assertEquals(String.class, tableModel.getColumnClass(0)); assertEquals(String.class, tableModel.getColumnClass(1)); }