ElementCollectionGrid extends CustomField<Collection<T>> implements NestedComponent, CanAssignEntity<ID, U> { public Grid<ValueHolder<T>> getGrid() { return grid; } ElementCollectionGrid(AttributeModel attributeModel, FormOptions formOptions); @Override void assignEntity(U t); Button getAddButton(); U getEntity(); FormOptions getFormOptions(); Integer getMaxLength(); Long getMaxValue(); Integer getMinLength(); Long getMinValue(); Object getSelectedItem(); @Override Collection<T> getValue(); boolean isViewMode(); void setEntity(U entity); void setFormOptions(final FormOptions formOptions); void setSelectedItem(final String selectedItem); void setViewMode(final boolean viewMode); @Override boolean validateAllFields(); Grid<ValueHolder<T>> getGrid();  }
@Test public void testTableOfLongs() { EntityModel<TestEntity> em = emf.getModel(TestEntity.class); FormOptions fo = new FormOptions(); ElementCollectionGrid<Integer, TestEntity, Long> grid = new ElementCollectionGrid<>(em.getAttributeModel("longTags"), fo); grid.setValue(Set.of(4L, 5L)); assertEquals(1, grid.getGrid().getColumns().size()); }