FruitBowl fruitBowl = new FruitBowl();
fruitBowl.addFruit(apple);
fruitBowl.addFruit(banana);
fruitBowl.addFruit(orange);
MuleEvent inEvent = new DefaultMuleEvent(new DefaultMuleMessage(fruitBowl, muleContext),
getTestEvent(""));
MuleEvent resultEvent = splitter.process(inEvent);
assertEquals(3, listener.events.size());
assertTrue(listener.events.get(0).getMessage().getPayload() instanceof Fruit);
assertTrue(listener.events.get(1).getMessage().getPayload() instanceof Fruit);
assertTrue(listener.events.get(2).getMessage().getPayload() instanceof Fruit);
assertEquals(DefaultMessageCollection.class, resultEvent.getMessage().getClass());
assertEquals(3, ((MuleMessageCollection) resultEvent.getMessage()).size());
assertTrue(((MuleMessageCollection) resultEvent.getMessage()).getMessage(0).getPayload() instanceof Fruit);
assertTrue(((MuleMessageCollection) resultEvent.getMessage()).getMessage(1).getPayload() instanceof Fruit);
assertTrue(((MuleMessageCollection) resultEvent.getMessage()).getMessage(2).getPayload() instanceof Fruit);
}