public void testEmbededIOReferenceItemsManyElems() throws Exception {
ArrayList<MenuItem> items = new ArrayList<MenuItem>();
MenuItem mockItem1 = EasyMock.createMock(MenuItem.class);
MenuItem mockItem2 = EasyMock.createMock(MenuItem.class);
BaseCommand mockCommand1 = EasyMock.createMock(BaseCommand.class);
BaseCommand mockCommand2 = EasyMock.createMock(BaseCommand.class);
EasyMock.expect(mockItem1.getCommand()).andReturn(mockCommand1);
EasyMock.expect(mockItem2.getCommand()).andReturn(mockCommand2);
mockCommand1.setEmbeded(EasyMock.eq("jbpm"));
EasyMock.expectLastCall().once();
mockCommand2.setEmbeded(EasyMock.eq("jbpm"));
EasyMock.expectLastCall().once();
items.add(mockItem1);
items.add(mockItem2);