@Test
public void testPackColumnWithMax() {

    JXTable table = new JXTable(new AncientSwingTeam());
    TableColumnExt columnExt = table.getColumnExt(0);
    table.getColumnFactory().packColumn(table, columnExt, -1, -1);
    int prefWidth = columnExt.getPreferredWidth();
    assertTrue("sanity: ", prefWidth > 10);
    int max = prefWidth - 5;
    table.getColumnFactory().packColumn(table, columnExt, -1, max);
    assertEquals("pref width must be bounded by max", 
            max, columnExt.getPreferredWidth());
}