### Question:
DefaultCategoryDataset extends AbstractDataset implements CategoryDataset, PublicCloneable, Serializable { public void removeColumn(int columnIndex) { this.data.removeColumn(columnIndex); fireDatasetChanged(); } DefaultCategoryDataset(); @Override int getRowCount(); @Override int getColumnCount(); @Override Number getValue(int row, int column); @Override Comparable getRowKey(int row); @Override int getRowIndex(Comparable key); @Override List<Comparable> getRowKeys(); @Override Comparable getColumnKey(int column); @Override int getColumnIndex(Comparable key); @Override List<Comparable> getColumnKeys(); @Override Number getValue(Comparable rowKey, Comparable columnKey); void addValue(Number value, Comparable rowKey,
                         Comparable columnKey); void addValue(double value, Comparable rowKey,
                         Comparable columnKey); void setValue(Number value, Comparable rowKey,
                         Comparable columnKey); void setValue(double value, Comparable rowKey,
                         Comparable columnKey); void incrementValue(double value,
                               Comparable rowKey,
                               Comparable columnKey); void removeValue(Comparable rowKey, Comparable columnKey); void removeRow(int rowIndex); void removeRow(Comparable rowKey); void removeColumn(int columnIndex); void removeColumn(Comparable columnKey); void clear(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testRemoveColumn() { DefaultCategoryDataset d = new DefaultCategoryDataset(); d.addValue(1.0, "R1", "C1"); d.addValue(2.0, "R2", "C2"); assertEquals(2, d.getColumnCount()); d.removeColumn("C2"); assertEquals(1, d.getColumnCount()); try { d.removeColumn("XXX"); fail("UnknownKeyException should have been thrown on unknown key"); } catch (UnknownKeyException e) { assertEquals("Unknown key: XXX", e.getMessage()); } try { d.removeColumn(null); fail("IllegalArgumentException should have been thrown on null key"); } catch (IllegalArgumentException e) { assertEquals("Null 'columnKey' argument.", e.getMessage()); } }