@Test public void testFutureUtilNoTimeout() throws Exception{ long startMillis = System.currentTimeMillis(); int value = FutureUtil.get(() ->{ ThreadUtil.sleep(1000); return 1; }); long endMillis = System.currentTimeMillis(); System.out.println(String.format("Value: %d, took %d ms", value, endMillis-startMillis)); TestCase.assertTrue(endMillis-startMillis >= 1000); TestCase.assertEquals(1, value); }
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);  }