@Override
    public void doUnregister(ServiceInstance serviceInstance) throws RuntimeException {
        execute(namingService, service -> {
            Instance instance = toInstance(serviceInstance);
            service.deregisterInstance(instance.getServiceName(), group, instance);
        });
    }
@Test
    void testDoUnRegister() throws NacosException {
        // register
        DefaultServiceInstance serviceInstance =
                createServiceInstance(SERVICE_NAME, LOCALHOST, NetUtils.getAvailablePort());
        // register
        nacosServiceDiscovery.doRegister(serviceInstance);

        // unRegister
        nacosServiceDiscovery.doUnregister(serviceInstance);

        ArgumentCaptor<Instance> instanceCaptor = ArgumentCaptor.forClass(Instance.class);
        verify(namingServiceWrapper, times(1)).deregisterInstance(any(), eq(group), instanceCaptor.capture());

        Instance capture = instanceCaptor.getValue();
        assertEquals(SERVICE_NAME, capture.getServiceName());
        assertEquals(LOCALHOST, capture.getIp());
        assertEquals(serviceInstance.getPort(), capture.getPort());
    }