### Question:
CheckBoxTableModel extends AbstractTableModel { public List<String> getCheckedValues() { List<String> results = New.list(myValues.size()); for (int index = 0; index < myValues.size(); ++index) { if (myBooleans.get(index).booleanValue()) { results.add(myValues.get(index)); } } return results; } CheckBoxTableModel(String checkBoxHeader, String valueHeader, Boolean initialCheckBoxState,
            Collection<? extends String> values); List<String> getCheckedValues(); @Override Class<?> getColumnClass(int columnIndex); @Override int getColumnCount(); @Override String getColumnName(int column); @Override int getRowCount(); @Override Object getValueAt(int rowIndex, int columnIndex); @Override boolean isCellEditable(int rowIndex, int columnIndex); void setCheckedValues(Collection<? extends String> values); @Override void setValueAt(Object aValue, int rowIndex, int columnIndex);  }### Answer:
@Test public void testGetCheckedValues() { Assert.assertEquals(VALUES, myModel.getCheckedValues()); myModel.setValueAt(Boolean.FALSE, 0, 0); Assert.assertEquals(VALUES.subList(1, VALUES.size()), myModel.getCheckedValues()); myModel.setValueAt(Boolean.TRUE, 0, 0); myModel.setValueAt(Boolean.FALSE, 1, 0); Assert.assertEquals(Arrays.asList("one", "three", "four"), myModel.getCheckedValues()); myModel.setValueAt(Boolean.FALSE, 0, 0); myModel.setValueAt(Boolean.FALSE, 2, 0); myModel.setValueAt(Boolean.FALSE, 3, 0); Assert.assertTrue(myModel.getCheckedValues().isEmpty()); }