code: public Object getCommand(String commandId, Class requiredType) throws CommandNotOfRequiredTypeException {
          
          Assert.notNull(commandId, "commandId");
          
          Object command = this.commandMap.get(commandId);
          
          if (command == null && this.parent != null) {
              command = this.parent.getCommand(commandId);
          }
          
          if (command == null) {
              return null;
          }
          
          if (requiredType != null && !ClassUtils.isAssignableValue(requiredType, command)) {
              throw new CommandNotOfRequiredTypeException(commandId, requiredType, command.getClass());
          }
          
          return command;
          
      }
docs: {@inheritDoc}