TablePreferences implements Serializable { public void registerListener(PreferencesChangedListener listener) { this.listeners.add(listener); } TablePreferences(List<? extends ColumnPreferences> prefs); void registerListener(PreferencesChangedListener listener); void unregisterListener(PreferencesChangedListener listener); int getSize(String colName); int getTotalSize(); int getMaxTotalSize(int max); void setSize(String colName, int newSize); boolean isVisible(String colName); void setVisible(String colName, boolean newVisible); List<SelectItem> getVisibiltyList(); void setVisibleColumns(List<String> colNames); List<String> getVisibleColumns(); void onResize(ColumnResizeEvent event);  }
@Test public void testRegisterListener_1() throws Exception { TablePreferences fixture = new TablePreferences(new LinkedList()); fixture.registerListener(new PreferencesBean()); PreferencesChangedListener listener = new PreferencesBean(); fixture.registerListener(listener); }