(Executor executor)
| 40 | } |
| 41 | |
| 42 | private static void takeTest(Executor executor) throws InterruptedException, ExecutionException { |
| 43 | ExecutorCompletionService<Object> ecs = new ExecutorCompletionService<Object>(executor); |
| 44 | final Object result = new Object(); |
| 45 | ecs.submit(new Callable<Object>() { |
| 46 | @Override |
| 47 | public Object call() throws Exception { |
| 48 | return result; |
| 49 | } |
| 50 | }); |
| 51 | |
| 52 | verify(ecs.take().get() == result); |
| 53 | } |
| 54 | } |