code: public void registerCommand(AbstractCommand command) {
          
          Assert.notNull(command, "Command cannot be null.");
          Assert.isTrue(command.getId() != null, "A command must have an identifier to be placed in a registry.");
          
          Object previousCommand = this.commandMap.put(command.getId(), command);
          
          if (previousCommand != null && logger.isWarnEnabled()) {
              logger.info("The command ["
                          + previousCommand
                          + "] was overwritten in the registry with the command ["
                          + command
                          + "]");
          }
          
          if (command instanceof CommandGroup) {
              ((CommandGroup) command).setCommandRegistry(this);
          }
          
          if (logger.isDebugEnabled()) {
              logger.debug("Command registered '" + command.getId() + "'");
          }
          
          fireCommandRegistered(command);
          
      }
docs: {@inheritDoc}