@Test(expected = ExecutionException.class) public void testRunException() throws Exception { Async.run(() -> { throw new RuntimeException(""); }).get(); }
public static <T> CompletableFuture<T> run(Callable<T> callable) { CompletableFuture<T> result = new CompletableFuture<>(); CompletableFuture.runAsync(() -> { try { result.complete(callable.call()); } catch (Throwable e) { result.completeExceptionally(e); } }, executor); return result; }
Async { public static <T> CompletableFuture<T> run(Callable<T> callable) { CompletableFuture<T> result = new CompletableFuture<>(); CompletableFuture.runAsync(() -> { try { result.complete(callable.call()); } catch (Throwable e) { result.completeExceptionally(e); } }, executor); return result; } }
Async { public static <T> CompletableFuture<T> run(Callable<T> callable) { CompletableFuture<T> result = new CompletableFuture<>(); CompletableFuture.runAsync(() -> { try { result.complete(callable.call()); } catch (Throwable e) { result.completeExceptionally(e); } }, executor); return result; }  }
Async { public static <T> CompletableFuture<T> run(Callable<T> callable) { CompletableFuture<T> result = new CompletableFuture<>(); CompletableFuture.runAsync(() -> { try { result.complete(callable.call()); } catch (Throwable e) { result.completeExceptionally(e); } }, executor); return result; }  static CompletableFuture<T> run(Callable<T> callable); static ScheduledExecutorService defaultExecutorService(); }
Async { public static <T> CompletableFuture<T> run(Callable<T> callable) { CompletableFuture<T> result = new CompletableFuture<>(); CompletableFuture.runAsync(() -> { try { result.complete(callable.call()); } catch (Throwable e) { result.completeExceptionally(e); } }, executor); return result; }  static CompletableFuture<T> run(Callable<T> callable); static ScheduledExecutorService defaultExecutorService();  }