| 36 | } |
| 37 | |
| 38 | private static void getCallableResultTest() throws InterruptedException, ExecutionException { |
| 39 | final Object result = new Object(); |
| 40 | FutureTask<Object> future = new FutureTask<Object>(new Callable<Object>() { |
| 41 | @Override |
| 42 | public Object call() throws Exception { |
| 43 | return result; |
| 44 | } |
| 45 | }); |
| 46 | |
| 47 | future.run(); |
| 48 | if (future.get() != result) { |
| 49 | throw new RuntimeException("Bad result returned: " + future.get()); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | private static void getRunnableResultTest() throws InterruptedException, ExecutionException { |
| 54 | final Object result = new Object(); |