@Test(expected = TestException.class) public void taskBaseException() { TestTask task = new TestTask("exception", 500, TestException::new); Future<String> future = executor.submit(task); FutureUtils.wait("exception", future, 1); }
public static <T> T wait(String message, Optional<Future<? extends T>> task) { if (task.isPresent()) { return wait(message, task.get()); } else { throw new TaskNotScheduledException(message); } }
FutureUtils { public static <T> T wait(String message, Optional<Future<? extends T>> task) { if (task.isPresent()) { return wait(message, task.get()); } else { throw new TaskNotScheduledException(message); } } }
FutureUtils { public static <T> T wait(String message, Optional<Future<? extends T>> task) { if (task.isPresent()) { return wait(message, task.get()); } else { throw new TaskNotScheduledException(message); } }  }
FutureUtils { public static <T> T wait(String message, Optional<Future<? extends T>> task) { if (task.isPresent()) { return wait(message, task.get()); } else { throw new TaskNotScheduledException(message); } }  static T wait(String message, Optional<Future<? extends T>> task); static T wait(String message, Future<T> task); static T wait(String message, Future<T> task, long seconds); }
FutureUtils { public static <T> T wait(String message, Optional<Future<? extends T>> task) { if (task.isPresent()) { return wait(message, task.get()); } else { throw new TaskNotScheduledException(message); } }  static T wait(String message, Optional<Future<? extends T>> task); static T wait(String message, Future<T> task); static T wait(String message, Future<T> task, long seconds);  }