in BoltsTest/src/bolts/TaskTest.java [139:149]
public void testBackgroundCallWaiting() throws Exception {
Task<Integer> task = Task.callInBackground(new Callable<Integer>() {
public Integer call() throws Exception {
Thread.sleep(100);
return 5;
}
});
task.waitForCompletion();
assertTrue(task.isCompleted());
assertEquals(5, task.getResult().intValue());
}