in BoltsTest/src/bolts/TaskTest.java [25:41]
private void runTaskTest(Callable<Task<?>> callable) {
try {
Task<?> task = callable.call();
task.waitForCompletion();
if (task.isFaulted()) {
Exception error = task.getError();
if (error instanceof RuntimeException) {
throw (RuntimeException) error;
}
throw new RuntimeException(error);
} else if (task.isCancelled()) {
throw new RuntimeException(new CancellationException());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}