String assertionFailure, JDOException ex) {
Throwable[] nesteds = ex.getNestedExceptions();
int numberOfExceptions = nesteds==null ? 0 : nesteds.length;
PersistenceManager[] result = new PersistenceManager[numberOfExceptions];
for (int i = 0; i < numberOfExceptions; ++i) {
JDOException exc = (JDOException)nesteds[i];
Object failedObject = exc.getFailedObject();
if (exc.getFailedObject() instanceof PersistenceManager) {
result[i] = (PersistenceManager)failedObject;
} else {
fail(assertionFailure,
"Unexpected failed object of type: " +
failedObject.getClass().getName());