import com.table.*;

import java.awt.event.MouseEvent;
import java.awt.Graphics;
import java.io.*;
import java.util.*;
import org.junit.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.mockito.InOrder;

public class ColumnTableModel_test {
    List<TableColumn> mockTable(int cols) {
        List list = new ArrayList();
        for(int i=0; i<cols; i++) list.add(mock(TableColumn.class));
        return list;
    }

    @Test
    public void testGetColumnCount() {
        ColumnTableModel ctm = new ColumnTableModel(mockTable(3));

        assertEquals(3, ctm.getColumnCount());
    }
    @Test
    public void testGetRowCount() {
        List<TableColumn> table = mockTable(3);
        ColumnTableModel ctm = new ColumnTableModel(table);

        when(table.get(0).getRowCount()).thenReturn(999);
        when(table.get(1).getRowCount()).thenReturn(99);
        when(table.get(2).getRowCount()).thenReturn(3200);

        assertEquals(99, ctm.getRowCount());
    }
    @Test
    public void testGetColumnName() {
        List<TableColumn> table = mockTable(3);
        ColumnTableModel ctm = new ColumnTableModel(table);

        when(table.get(0).getName()).thenReturn("Bob");

        assertEquals("Bob", ctm.getColumnName(0));
    }
    @Test
    public void testGetValue() {
        List<TableColumn> table = mockTable(3);
        ColumnTableModel ctm = new ColumnTableModel(table);

        when(table.get(2).getValueAt(3)).thenReturn("Value");

        assertEquals("Value", ctm.getValueAt(3,2));
    }
    @Test
    public void testGetColumnClass() {
        List<TableColumn> table = mockTable(3);
        ColumnTableModel ctm = new ColumnTableModel(table);

        when(table.get(0).getDataClass()).thenReturn(String.class);

        assertEquals(String.class, ctm.getColumnClass(0));
    }
    @Test
    public void testIsCellEditable() {
        List<TableColumn> table = mockTable(3);
        ColumnTableModel ctm = new ColumnTableModel(table);

        when(table.get(1).isRowEditable(0)).thenReturn(true);

        assertEquals(true, ctm.isCellEditable(0,1));
    }
    @Test
    public void testSetValue() {
        List<TableColumn> table = mockTable(3);
        ColumnTableModel ctm = new ColumnTableModel(table);

        when(table.get(1).getDataClass()).thenReturn(String.class);
        when(table.get(1).isRowEditable(0)).thenReturn(true);
        ctm.setValueAt("Value", 0, 1);

        verify(table.get(1)).setValueAt("Value", 0);
    }
}

@@ -289,16 +289,19 @@
 leColumn
+%3C?%3E
 %3E mockTa
@@ -312,24 +312,24 @@
 int cols) %7B%0A
-
         List
@@ -682,32 +682,35 @@
 List%3CTableColumn
+%3C?%3E
 %3E table = mockTa
@@ -1068,32 +1068,35 @@
 List%3CTableColumn
+%3C?%3E
 %3E table = mockTa
@@ -1337,32 +1337,35 @@
 List%3CTableColumn
+%3C?%3E
 %3E table = mockTa
@@ -1485,16 +1485,24 @@
 nReturn(
+(Object)
 %22Value%22)
@@ -1627,32 +1627,35 @@
 List%3CTableColumn
+%3C?%3E
 %3E table = mockTa
@@ -1728,32 +1728,55 @@
 ;%0A%0A        when(
+ ((TableColumn%3CString%3E)
 table.get(0).get
@@ -1767,24 +1767,25 @@
 table.get(0)
+)
 .getDataClas
@@ -1779,33 +1779,47 @@
 ).getDataClass()
-)
+ )%0A            
 .thenReturn(Stri
@@ -1960,32 +1960,35 @@
 List%3CTableColumn
+%3C?%3E
 %3E table = mockTa
@@ -2245,16 +2245,19 @@
 leColumn
+%3C?%3E
 %3E table 
@@ -2338,32 +2338,55 @@
 ;%0A%0A        when(
+ ((TableColumn%3CString%3E)
 table.get(1).get
@@ -2377,24 +2377,25 @@
 table.get(1)
+)
 .getDataClas
@@ -2397,17 +2397,31 @@
 aClass()
-)
+ )%0A            
 .thenRet
@@ -2537,24 +2537,24 @@
 e%22, 0, 1);%0A%0A
-
         veri
@@ -2556,16 +2556,37 @@
  verify(
+(TableColumn%3CString%3E)
 table.ge

Update test for new templated interface