UberfireColumnPicker { public void addColumns(List<ColumnMeta<T>> columnMetas) { columnMetaList.addAll(columnMetas); sortAndAddColumns(columnMetas); adjustColumnWidths(); } UberfireColumnPicker(DataGrid<T> dataGrid); void addColumnChangedHandler(ColumnChangedHandler handler); Collection<ColumnMeta<T>> getColumnMetaList(); void columnMoved(final int visibleFromIndex,
                            final int visibleBeforeIndex); void addColumn(ColumnMeta<T> columnMeta); void adjustColumnWidths(); void addColumns(List<ColumnMeta<T>> columnMetas); void removeColumn(ColumnMeta<T> columnMeta); Button createToggleButton(); int getDataGridMinWidth(); void setDefaultColumnWidthSize(int defaultColumSize);  }
@Test public void testAddColumns() { UberfireColumnPicker<String> columnPicker = new UberfireColumnPicker<>(new DataGrid<>()); ColumnMeta<String> name = createColumnMeta("Name", "name", true, true, 0); ColumnMeta<String> age = createColumnMeta("Age", "age", true, true, 3); ColumnMeta<String> description = createColumnMeta("Description", "description", false, true, 1); ColumnMeta<String> actions = createColumnMeta("Actions", "actions", true, false, 2); ColumnMeta<String> etc = createColumnMeta("Etc", "etc", true, true, 4); columnPicker.addColumns(Arrays.asList(name, age, description, actions, etc)); assertEquals(4, columnPicker.getDataGrid().getColumnCount()); assertEquals("name", columnPicker.getDataGrid().getColumn(0).getDataStoreName()); assertEquals("age", columnPicker.getDataGrid().getColumn(1).getDataStoreName()); assertEquals("etc", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); assertEquals("actions", columnPicker.getDataGrid().getColumn(3).getDataStoreName()); }