assertEquals("number of MP instances", 2, container.getProcessorCount());
assertTrue("queue is empty", outputQueue.isEmpty());
container.outputPass();
OutputMessage out1 = (OutputMessage)serializer.deserialize((byte[]) outputQueue.poll(1000, TimeUnit.MILLISECONDS));
OutputMessage out2 = (OutputMessage)serializer.deserialize((byte[]) outputQueue.poll(1000, TimeUnit.MILLISECONDS));
assertTrue("messages received", (out1 != null) && (out2 != null));
assertEquals("no more messages in queue", 0, outputQueue.size());
// order of messages is not guaranteed, so we need to aggregate keys
HashSet<String> messageKeys = new HashSet<String>();
messageKeys.add(out1.getKey());
messageKeys.add(out2.getKey());
assertTrue("first MP sent output", messageKeys.contains("foo"));
assertTrue("second MP sent output", messageKeys.contains("bar"));
}