### Question:
StudyMeasurementTableModel extends AbstractTableModel { public Object getValueAt(int rowIndex, int columnIndex) { Key key = getKeyAt(rowIndex, columnIndex); if (isVariableColumn(columnIndex)) { return key.v.getValue().getName(); } if (isMeasurementMomentColumn(columnIndex)) { return key.wt; } return d_mmpMap.get(key.getMeasurementKey()); } StudyMeasurementTableModel(Study study, PresentationModelFactory pmf, Class<? extends Variable> type, boolean hasOverallColumn); @Override Class<?> getColumnClass(int columnIndex); int getColumnCount(); int getRowCount(); @Override boolean isCellEditable(int row, int col); @Override String getColumnName(int col); Object getValueAt(int rowIndex, int columnIndex);  }### Answer:
@Test public void testGetWhenTaken() { assertEquals("0 weeks from start of Main phase", d_model.getValueAt(0, 1).toString()); assertEquals("0 weeks before end of Main phase", d_model.getValueAt(1, 1).toString()); }
@Test public void testGetValueAt() { int index = 0; for (StudyOutcomeMeasure<Endpoint> v : d_standardStudy.getEndpoints()) { for (WhenTaken wt : v.getWhenTaken()) { assertEquals(v.getValue().getName(), d_model.getValueAt(index, 0)); assertEquals(wt, d_model.getValueAt(index, 1)); measurementCorrectlyBound(d_standardStudy, v.getValue(), wt, d_standardStudy.getArms().get(0), (MissingMeasurementPresentation)d_model.getValueAt(index, 2)); measurementCorrectlyBound(d_standardStudy, v.getValue(), wt, d_standardStudy.getArms().get(1), (MissingMeasurementPresentation)d_model.getValueAt(index, 3)); ++index; } } }
@Test public void testPopcharGetValueAt() { int index = 0; for (Variable v : d_popcharStudy.getVariables(PopulationCharacteristic.class)) { assertEquals(v.getName(), d_popcharTablemodel.getValueAt(index, 0)); WhenTaken wt = d_popcharStudy.defaultMeasurementMoment(); measurementCorrectlyBound(d_popcharStudy, v, wt, d_popcharStudy.getArms().get(0), (MissingMeasurementPresentation)d_popcharTablemodel.getValueAt(index, 2)); measurementCorrectlyBound(d_popcharStudy, v, wt, d_popcharStudy.getArms().get(1), (MissingMeasurementPresentation)d_popcharTablemodel.getValueAt(index, 3)); measurementCorrectlyBound(d_popcharStudy, v, wt, null, (MissingMeasurementPresentation)d_popcharTablemodel.getValueAt(index, 4)); ++index; } }