public SimpleProblemCollector call() throws Exception {
final ObjectWithMixedProtection obj = getValueList();
final ModelBuildingRequest config = createModelBuildingRequest(p);
countDownLatch.await();
final SimpleProblemCollector collector = new SimpleProblemCollector();
interpolator.interpolateObject( obj, model, new File( "." ), config, collector);
return collector;
}
};
FutureTask<SimpleProblemCollector> task = new FutureTask<SimpleProblemCollector>(future);
futures.add ( task);
new Thread( task).start();
}
countDownLatch.countDown(); // Start all the threads
for(Future<SimpleProblemCollector> result : futures){
SimpleProblemCollector problemCollector = result.get(); // ArrayIndexOutOfBoundsException are typical indication of threading issues
assertProblemFree( problemCollector );
}
}