@Test (expected = TimeoutException.class) public void testFutureUtilWithTimeout() throws Exception{ long startMillis = System.currentTimeMillis(); int value = FutureUtil.get(() ->{ ThreadUtil.sleep(6000); return 1; }, 1); long endMillis = System.currentTimeMillis(); System.out.println(String.format("Value: %d, took %d ms", value, endMillis-startMillis)); Assert.fail(); }
public static <E> E get(Task<E> task) throws Exception { return get(task, 30L); }
FutureUtil { public static <E> E get(Task<E> task) throws Exception { return get(task, 30L); } }
FutureUtil { public static <E> E get(Task<E> task) throws Exception { return get(task, 30L); }  }
FutureUtil { public static <E> E get(Task<E> task) throws Exception { return get(task, 30L); }  static E get(Task<E> task); static E get(Task<E> task, long timeout); }
FutureUtil { public static <E> E get(Task<E> task) throws Exception { return get(task, 30L); }  static E get(Task<E> task); static E get(Task<E> task, long timeout);  }