EntityComboBox extends ComboBox<T> implements Refreshable, Cascadable<T> { @SuppressWarnings("unchecked") public void addEntity(T entity) { ListDataProvider<T> provider = (ListDataProvider<T>) this.getDataProvider(); provider.getItems().add(entity); provider.refreshAll(); } EntityComboBox(EntityModel<T> targetEntityModel, AttributeModel attributeModel, BaseService<ID, T> service,
			SelectMode mode, SerializablePredicate<T> filter, ListDataProvider<T> sharedProvider, List<T> items,
			SortOrder<?>... sortOrders); @SafeVarargs  EntityComboBox(EntityModel<T> targetEntityModel, AttributeModel attributeModel, BaseService<ID, T> service,
			SerializablePredicate<T> filter, ListDataProvider<T> sharedProvider, SortOrder<?>... sortOrders); @SafeVarargs  EntityComboBox(EntityModel<T> targetEntityModel, AttributeModel attributeModel, BaseService<ID, T> service,
			SortOrder<?>... sortOrder);  EntityComboBox(EntityModel<T> targetEntityModel, AttributeModel attributeModel, List<T> items); @SuppressWarnings("unchecked") void addEntity(T entity); @Override void clearAdditionalFilter(); @Override SerializablePredicate<T> getAdditionalFilter(); AttributeModel getAttributeModel(); @SuppressWarnings("unchecked") int getDataProviderSize(); SerializablePredicate<T> getFilter(); @SuppressWarnings("unchecked") T getFirstItem(); SelectMode getSelectMode(); SortOrder<?>[] getSortOrder(); @SuppressWarnings("unchecked") @Override void refresh(); void refresh(SerializablePredicate<T> filter); @Override void setAdditionalFilter(SerializablePredicate<T> additionalFilter); void setFilter(SerializablePredicate<T> filter); void setSelectMode(SelectMode selectMode);  }
@Test public void testAddEntity() { EntityComboBox<Integer, TestEntity> select = new EntityComboBox<>(factory.getModel(TestEntity.class), null, service, new EqualsPredicate<TestEntity>("name", "Bob"), null); assertEquals(0, select.getDataProviderSize()); TestEntity te = new TestEntity("stewart", 77L); select.addEntity(te); assertEquals(1, select.getDataProviderSize()); assertEquals(te, select.getFirstItem()); }