Outcome res = ua.end();
if (res instanceof XAOutcome)
{
XAOutcome out = (XAOutcome) res;
if (out.data() == null) {
System.out.println("Result is "+((XAException) out.data()));
} else {
fail("XAOutcome has non-null data " + out.data());
}
} else {
fail("Non-XAOutcome result " + res);
}
}