List<Object> publishedMessages = bus.getPublishedMessages();
assertEquals("Two messages were published, one for each loaded plugin", 2, publishedMessages.size());
PluginLoaded pluginLoaded1 = (PluginLoaded) publishedMessages.get(0);
PluginLoaded pluginLoaded2 = (PluginLoaded) publishedMessages.get(1);
assertSame("First message contains plugin #1", plugin1, pluginLoaded1.getPlugin());
assertSame("Second message contains plugin #2", plugin2, pluginLoaded2.getPlugin());
}