};
commands.add(command);
}
// execute the commands
final CommandExecutor commandExecutor = new CommandExecutorImpl();
ExecutorService executorService = Executors.newFixedThreadPool(numOfConcurrentThreads);
final List<String> revisionIds = new LinkedList<String>();
for (int i = 0; i < numOfConcurrentThreads; ++i) {
final CommitCommandMongo command = commands.get(i);
Runnable runnable = new Runnable() {
@Override
public void run() {
try {
String revisionId = commandExecutor.execute(command);
revisionIds.add(revisionId);
} catch (Exception e) {
revisionIds.add(null);
}
}