### Question:
StudyMeasurementTableModel extends AbstractTableModel { @Override public String getColumnName(int col) { if (isVariableColumn(col)) { return CategoryKnowledgeFactory.getCategoryKnowledge(d_type).getSingularCapitalized(); } else if (isMeasurementMomentColumn(col)) { return "Measurement moment"; } else if (isOverallColumn(col)) { return "Overall"; } return d_pmf.getLabeledModel(d_study.getArms().get(col-2)).getLabelModel().getString(); } 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 testGetPopcharColumnName() { assertEquals("Population characteristic", d_popcharTablemodel.getColumnName(0)); for (int i = 0; i < d_popcharStudy.getArms().size(); i++) { String exp = d_pmf.getLabeledModel(d_popcharStudy.getArms().get(i)).getLabelModel().getString(); String cname= d_popcharTablemodel.getColumnName(i + 2); assertEquals(exp, cname); } assertEquals("Overall", d_popcharTablemodel.getColumnName(4)); }
@Test public void testGetColumnName() { assertEquals("Endpoint", d_model.getColumnName(0)); for (int i = 0; i < d_standardStudy.getArms().size(); ++i) { String exp = d_pmf.getLabeledModel(d_standardStudy.getArms().get(i)).getLabelModel().getString(); String cname = d_model.getColumnName(i + 2); assertEquals(exp, cname); } }