}
List unmappedPms = new ArrayList();
StringBuffer mb = new StringBuffer ();
for (Iterator i = pms.iterator(); i.hasNext(); ) {
PrioritizedMessage pm = (PrioritizedMessage)i.next();
unmappedPms.add(pm.unmappedMessage());
mb.append (" " + pm.unmappedMessage());
}
if (errorMessage != null) {
assertTrue("Expected " + errorMessage + ", got" + mb.toString(),
unmappedPms.contains(errorMessage));