Long currentTime = System.currentTimeMillis();
synchronized (scheduledCommands) {
for (Iterator<Map.Entry<Command, DuplicateScheduleConfig>> it = scheduledCommands.entrySet().iterator(); it.hasNext(); ) {
Map.Entry<Command, DuplicateScheduleConfig> entry = it.next();
DuplicateScheduleConfig config = entry.getValue();
Command command = entry.getKey();
// if timeout
if (config.getTime() < currentTime) {
// command is currently running
if (runningCommands.contains(command)) {