@Test public void testMultithreadedDates() throws Exception { int numThreads = 10; ExecutorService executorService = Executors.newFixedThreadPool(numThreads); ExecutorCompletionService<Integer> executorCompletionService = new ExecutorCompletionService<Integer>(executorService); for (int i = 0; i < numThreads; i++) { executorCompletionService.submit(new MetadataDateAdder()); } int finished = 0; while (finished < numThreads) { Future<Integer> future = executorCompletionService.take(); if (future != null && future.isDone()) { Integer retVal = future.get(); finished++; } } }