### Question:
StudyCharTableModel extends AbstractTableModel { public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex < 0 || columnIndex >= getColumnCount()) { throw new IndexOutOfBoundsException("column index (" + columnIndex + ") out of bounds"); } if (rowIndex < 0 || rowIndex >= getRowCount()) { throw new IndexOutOfBoundsException("row index (" + rowIndex + ") out of bounds"); } if (columnIndex == 0) { return d_pm.getIncludedStudies().get(rowIndex); } Characteristic c = getCharacteristic(columnIndex); StudyPresentation spm = (StudyPresentation) d_pmf.getModel(d_pm.getIncludedStudies().get(rowIndex)); return spm.getCharacteristicModel(c).getValue(); } StudyCharTableModel(StudyListPresentation pm, PresentationModelFactory pmf); int getColumnCount(); int getRowCount(); Object getValueAt(int rowIndex, int columnIndex); @Override String getColumnName(int columnIndex); @Override Class<?> getColumnClass(int columnIndex);  }### Answer:
@Test public void testGetValueAt() { int row = 0; for (Study s : d_pm.getIncludedStudies()) { assertEquals(s, d_model.getValueAt(row, 0)); int column = 1; for (Characteristic c : StudyCharacteristics.values()) { StudyPresentation model = (StudyPresentation) d_pmf.getModel(s); assertEquals(model.getCharacteristicModel(c).getValue(), d_model.getValueAt(row, column)); ++column; } ++row; } }
@Test public void testGetValueAtColumnRemoved() { getFirstCharValueModel().setValue(false); int row = 0; for (Study s : d_pm.getIncludedStudies()) { assertEquals(s, d_model.getValueAt(row, 0)); int column = 0; for (Characteristic c : StudyCharacteristics.values()) { if (column > 0) { StudyPresentation model = (StudyPresentation) d_pmf.getModel(s); assertEquals(model.getCharacteristicModel(c).getValue(), d_model.getValueAt(row, column)); } ++column; } ++row; } }