public void registerCommand(String commandName, CommandHandler handler) {
        if (StringUtil.isEmpty(commandName) || handler == null) {
            return;
        }

        if (handlerMap.containsKey(commandName)) {
            CommandCenterLog.warn("[NettyHttpCommandCenter] Register failed (duplicate command): " + commandName);
            return;
        }

        handlerMap.put(commandName, handler);
    }
@Test
    public void testRegisterCommand() {
        String commandName;
        CommandHandler handler;

        // If commandName is null, no handler added in handlerMap
        commandName = null;
        handler = new VersionCommandHandler();
        httpServer.registerCommand(commandName, handler);
        assertEquals(0, HttpServer.handlerMap.size());

        // If commandName is "", no handler added in handlerMap
        commandName = "";
        handler = new VersionCommandHandler();
        httpServer.registerCommand(commandName, handler);
        assertEquals(0, HttpServer.handlerMap.size());

        // If handler is null, no handler added in handlerMap
        commandName = "version";
        handler = null;
        httpServer.registerCommand(commandName, handler);
        assertEquals(0, HttpServer.handlerMap.size());

        // Add one handler, commandName:version, handler:VersionCommandHandler
        commandName = "version";
        handler = new VersionCommandHandler();
        httpServer.registerCommand(commandName, handler);
        assertEquals(1, HttpServer.handlerMap.size());

        // Add the same name Handler, no handler added in handlerMap
        commandName = "version";
        handler = new VersionCommandHandler();
        httpServer.registerCommand(commandName, handler);
        assertEquals(1, HttpServer.handlerMap.size());

        // Add another handler, commandName:basicInfo, handler:BasicInfoCommandHandler
        commandName = "basicInfo";
        handler = new BasicInfoCommandHandler();
        httpServer.registerCommand(commandName, handler);
        assertEquals(2, HttpServer.handlerMap.size());
    }