}
@Test
public void testFormItemAddedOnLeaf() throws Exception {
FBForm rootItem = EasyMock.createMock(FBForm.class);
LayoutFormItem parentItem = EasyMock.createMock(LayoutFormItem.class);
FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
//EasyMock.expect(formItem.getParent()).andReturn(parentItem).once();
List<FBFormItem> items = new ArrayList<FBFormItem>();
items.add(formItem);
EasyMock.expect(parentItem.getItems()).andReturn(items).atLeastOnce();
view.addFormItem(EasyMock.same(parentItem), EasyMock.same(rootItem));
EasyMock.expectLastCall().once();
view.addFormItem(EasyMock.same(formItem), EasyMock.same(parentItem));
EasyMock.expectLastCall().once();
view.addFormItem(EasyMock.same(formItem), EasyMock.isNull(FBCompositeItem.class));