List listeners = helper.getListeners();
assertEquals(3, listeners.size());
Listener listener0 = (Listener) listeners.get(0);
assertEquals(ListenerTestPlugin.class, listener0.getClass());
ListenerTestPlugin testListener0 = (ListenerTestPlugin) listener0;
assertEquals("project4-0", testListener0.getString());
Listener listener1 = (Listener) listeners.get(1);
assertEquals(ListenerTestPlugin.class, listener1.getClass());
ListenerTestPlugin testListener1 = (ListenerTestPlugin) listener1;
assertEquals("listener1", testListener1.getString());
assertEquals("wrapper1", testListener1.getStringWrapper().getString());
Listener listener2 = (Listener) listeners.get(2);
assertEquals(ListenerTestPlugin.class, listener2.getClass());
ListenerTestPlugin testListener2 = (ListenerTestPlugin) listener2;
assertEquals("listener2", testListener2.getString());
// note this is in fact undefined behavior!! Because we added twice the stringwrapper
// (first for the child, then for the parent).
// this could probably fail depending on a different platform, except if Element.setContent()
// specifies the order in which children are kept within the element.
final String wrapper = testListener2.getStringWrapper().getString();
assertTrue("wrapper2-works!", "wrapper2-works!".equals(wrapper)
|| "wrapper1".equals(wrapper));
}