assertEquals("ignoreCount", result.getIgnoreCount(), fromStream.getIgnoreCount());
assertEquals("runTime", result.getRunTime(), fromStream.getRunTime());
assertEquals("failures", result.getFailures().size(), fromStream.getFailures().size());
int index = 0;
for (Failure failure : result.getFailures()) {
Failure failureFromStream = fromStream.getFailures().get(index);
String messagePrefix = String.format("failures[%d]", index++);
assertEquals(messagePrefix + ".description",
failure.getDescription(), failureFromStream.getDescription());
Throwable exception = failure.getException();
Throwable exceptionFromStream = failureFromStream.getException();
assertEquals(messagePrefix + ".exception",
exception.getClass(), exceptionFromStream.getClass());
assertEquals(messagePrefix + ".exception",
exception.getMessage(), exceptionFromStream.getMessage());
}