@Test public void testAddItemAt() { BeanContainer<String, String> container = new BeanContainer<String, String>( String.class); container.addItem("id1", "value1"); container.addItemAt(0, "id2", "value2"); container.addItemAt(1, "id3", "value3"); container.addItemAt(container.size(), "id4", "value4"); assertNull(container.addItemAt(-1, "id5", "value5")); assertNull(container.addItemAt(container.size() + 1, "id6", "value6")); assertEquals(4, container.size()); assertEquals("id2", container.getIdByIndex(0)); assertEquals("id3", container.getIdByIndex(1)); assertEquals("id1", container.getIdByIndex(2)); assertEquals("id4", container.getIdByIndex(3)); }
@Override public BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAt(index, newItemId, bean); } else { return null; } }
BeanContainer extends
        AbstractBeanContainer<IDTYPE, BEANTYPE> { @Override public BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAt(index, newItemId, bean); } else { return null; } } }
BeanContainer extends
        AbstractBeanContainer<IDTYPE, BEANTYPE> { @Override public BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAt(index, newItemId, bean); } else { return null; } } BeanContainer(Class<? super BEANTYPE> type); }
BeanContainer extends
        AbstractBeanContainer<IDTYPE, BEANTYPE> { @Override public BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAt(index, newItemId, bean); } else { return null; } } BeanContainer(Class<? super BEANTYPE> type); @Override BeanItem<BEANTYPE> addItem(IDTYPE itemId, BEANTYPE bean); @Override BeanItem<BEANTYPE> addItemAfter(IDTYPE previousItemId,
            IDTYPE newItemId, BEANTYPE bean); @Override BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId,
            BEANTYPE bean); void setBeanIdProperty(Object propertyId); @Override // overridden to make void setBeanIdResolver(
            BeanIdResolver<IDTYPE, BEANTYPE> beanIdResolver); @Override // overridden to make BeanItem<BEANTYPE> addBean(BEANTYPE bean); @Override // overridden to make BeanItem<BEANTYPE> addBeanAfter(IDTYPE previousItemId, BEANTYPE bean); @Override // overridden to make BeanItem<BEANTYPE> addBeanAt(int index, BEANTYPE bean); @Override // overridden to make void addAll(Collection<? extends BEANTYPE> collection); }
BeanContainer extends
        AbstractBeanContainer<IDTYPE, BEANTYPE> { @Override public BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAt(index, newItemId, bean); } else { return null; } } BeanContainer(Class<? super BEANTYPE> type); @Override BeanItem<BEANTYPE> addItem(IDTYPE itemId, BEANTYPE bean); @Override BeanItem<BEANTYPE> addItemAfter(IDTYPE previousItemId,
            IDTYPE newItemId, BEANTYPE bean); @Override BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId,
            BEANTYPE bean); void setBeanIdProperty(Object propertyId); @Override // overridden to make void setBeanIdResolver(
            BeanIdResolver<IDTYPE, BEANTYPE> beanIdResolver); @Override // overridden to make BeanItem<BEANTYPE> addBean(BEANTYPE bean); @Override // overridden to make BeanItem<BEANTYPE> addBeanAfter(IDTYPE previousItemId, BEANTYPE bean); @Override // overridden to make BeanItem<BEANTYPE> addBeanAt(int index, BEANTYPE bean); @Override // overridden to make void addAll(Collection<? extends BEANTYPE> collection);  }