found = true;
break;
}
if(!found) {
if(predicates.length == 1)
throw new ComparisonFailure(
"Predicate does not match", predicates[0].toString(), diagnosticsToString(d));
throw new ComparisonFailure(
"No predicate in expected matches", Arrays.toString(predicates), diagnosticsToString(d));
}
}
ArrayList<DiagnosticPredicate> unconsumed = new ArrayList<DiagnosticPredicate>();
for(Entry<DiagnosticPredicate, Boolean> e : consumed.entrySet())
if(!e.getValue() && e.getKey().isRequired())
unconsumed.add(e.getKey());
if(unconsumed.size() != 0)
throw new ComparisonFailure(
"Missing diagnostics for required predicates", Arrays.toString(unconsumed.toArray()),
diagnosticsToString(asserted));
}