@Test public void testItemRemovedEvent_RemovedItem() { BeanItemContainer<Person> container = new BeanItemContainer<Person>( Person.class); Person bean = new Person("John"); container.addItem(bean); ItemSetChangeListener removeListener = createListenerMockFor(container); Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent( removeListener); EasyMock.replay(removeListener); container.removeItem(bean); assertEquals(bean, capturedEvent.getValue().getFirstItemId()); }
@Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItem(Object itemId) { return super.addBean((BEANTYPE) itemId); }
BeanItemContainer extends
        AbstractBeanContainer<BEANTYPE, BEANTYPE> { @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItem(Object itemId) { return super.addBean((BEANTYPE) itemId); } }
BeanItemContainer extends
        AbstractBeanContainer<BEANTYPE, BEANTYPE> { @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItem(Object itemId) { return super.addBean((BEANTYPE) itemId); } BeanItemContainer(Class<? super BEANTYPE> type); @SuppressWarnings("unchecked") @Deprecated  BeanItemContainer(Collection<? extends BEANTYPE> collection);  BeanItemContainer(Class<? super BEANTYPE> type,
            Collection<? extends BEANTYPE> collection); }
BeanItemContainer extends
        AbstractBeanContainer<BEANTYPE, BEANTYPE> { @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItem(Object itemId) { return super.addBean((BEANTYPE) itemId); } BeanItemContainer(Class<? super BEANTYPE> type); @SuppressWarnings("unchecked") @Deprecated  BeanItemContainer(Collection<? extends BEANTYPE> collection);  BeanItemContainer(Class<? super BEANTYPE> type,
            Collection<? extends BEANTYPE> collection); @Override void addAll(Collection<? extends BEANTYPE> collection); @Override @SuppressWarnings("unchecked") BeanItem<BEANTYPE> addItemAfter(Object previousItemId,
            Object newItemId); @Override @SuppressWarnings("unchecked") BeanItem<BEANTYPE> addItemAt(int index, Object newItemId); @Override @SuppressWarnings("unchecked") BeanItem<BEANTYPE> addItem(Object itemId); @Override BeanItem<BEANTYPE> addBean(BEANTYPE bean); }
BeanItemContainer extends
        AbstractBeanContainer<BEANTYPE, BEANTYPE> { @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItem(Object itemId) { return super.addBean((BEANTYPE) itemId); } BeanItemContainer(Class<? super BEANTYPE> type); @SuppressWarnings("unchecked") @Deprecated  BeanItemContainer(Collection<? extends BEANTYPE> collection);  BeanItemContainer(Class<? super BEANTYPE> type,
            Collection<? extends BEANTYPE> collection); @Override void addAll(Collection<? extends BEANTYPE> collection); @Override @SuppressWarnings("unchecked") BeanItem<BEANTYPE> addItemAfter(Object previousItemId,
            Object newItemId); @Override @SuppressWarnings("unchecked") BeanItem<BEANTYPE> addItemAt(int index, Object newItemId); @Override @SuppressWarnings("unchecked") BeanItem<BEANTYPE> addItem(Object itemId); @Override BeanItem<BEANTYPE> addBean(BEANTYPE bean);  }