class MotanHandlerRegistry extends HandlerRegistry {
    private ConcurrentHashMap<String, ServerMethodDefinition<?, ?>> methods = new ConcurrentHashMap<String, ServerMethodDefinition<?, ?>>();

    @Override
    public ServerMethodDefinition<?, ?> lookupMethod(String methodName, String authority) {
        return methods.get(methodName);
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public void addService(ServerServiceDefinition service, Provider provider) {<FILL_FUNCTION_BODY>}

    @SuppressWarnings("rawtypes")
    public void addService(BindableService bindableService, Provider provider) {
        addService(bindableService.bindService(), provider);
    }

    public void removeService(ServerServiceDefinition service) {
        if (service != null) {
            for (ServerMethodDefinition<?, ?> method : service.getMethods()) {
                methods.remove(method.getMethodDescriptor().getFullMethodName());
            }
        }
    }


}


        for (ServerMethodDefinition<?, ?> method : service.getMethods()) {
            Method providerMethod = GrpcUtil.getMethod(method.getMethodDescriptor().getFullMethodName(), provider.getInterface());
            MotanServerCallHandler handler;
            if (method.getServerCallHandler() instanceof MotanServerCallHandler) {
                handler = (MotanServerCallHandler) method.getServerCallHandler();
            } else {
                handler = new MotanServerCallHandler();
                method = method.withServerCallHandler(handler);
            }
            handler.init(provider, providerMethod);
            if (GrpcUtil.JSON_CODEC.equals(provider.getUrl().getParameter(URLParamType.serialize.getName()))) {
                MethodDescriptor jsonDesc = GrpcUtil.convertJsonDescriptor(method.getMethodDescriptor(), providerMethod.getParameterTypes()[0], providerMethod.getReturnType());
                if(jsonDesc != null){
                    method = ServerMethodDefinition.create(jsonDesc, method.getServerCallHandler());
                    LoggerUtil.info("grpc method " + jsonDesc.getFullMethodName() +" use codec json.");
                }
            }
            methods.put(method.getMethodDescriptor().getFullMethodName(), method);
        }
    
<no_super_class>