private static Object[] getSortedArrayOfErrorSummaryEntries(TestResult result) {
Map map = new HashMap();
for (Enumeration e=result.errors(); e.hasMoreElements(); ) {
TestFailure testFailure = (TestFailure) e.nextElement();
Throwable t = testFailure.thrownException();
String message = getRootCause(t).toString();
ErrorSummaryEntry errorSummaryEntry = (ErrorSummaryEntry) map.get(message);
if (errorSummaryEntry==null ) {
errorSummaryEntry = new ErrorSummaryEntry(t);
map.put(message, errorSummaryEntry);