}
nextCmd.setStatus(OperationStatus.WRITING);
Command removedCommand = (Command) writeQueue.remove();
// If the key is exists,add the command to associated list.
if (mergeCommands.containsKey(removedCommand.getKey())) {
final AssocCommandAware mergedGetCommand = (AssocCommandAware) mergeCommands
.get(removedCommand.getKey());
if (mergedGetCommand.getAssocCommands() == null) {
mergedGetCommand
.setAssocCommands(new ArrayList<Command>(5));
}
mergedGetCommand.getAssocCommands().add(removedCommand);
} else {
commandCollector.visit(nextCmd);
mergeCommands.put(removedCommand.getKey(), removedCommand);
}
mergeCount++;