boolean registerCommand(final MessageType messageType,
      final Map<KnownVersion, Command> versionToNewCommand,
      final LinkedHashMap<KnownVersion, ConcurrentMap<MessageType, Command>> allCommands) {
    boolean modified = false;
    Command command = null;

    for (Map.Entry<KnownVersion, ConcurrentMap<MessageType, Command>> entry : allCommands
        .entrySet()) {
      KnownVersion version = entry.getKey();

      // Get the current set of commands for this version.
      Map<MessageType, Command> commandMap = entry.getValue();

      // See if we have a new command to insert into this map. Otherwise, keep using the command we
      // have already read
      Command newCommand = versionToNewCommand.get(version);
      if (newCommand != null) {
        command = newCommand;
      }
      if (command != null) {
        Command oldCommand = commandMap.get(messageType);
        if (oldCommand != null && oldCommand != command) {
          throw new InternalGemFireError("Command is already defined int the map for message Type "
              + messageType + ". Old Value=" + commandMap.get(messageType)
              + ", newValue=" + command + ", version=" + version);
        }
        commandMap.put(messageType, command);
        modified = true;
      }
    }
    return modified;
  }
Iterate through all the Geode versions add a command to the map for that version

@return returns true if command was registered or same command was already registered,
        otherwise false.
@throws InternalGemFireError if a different command was already registered.
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CommandInitializer.java