public String getNamingAddr() {
        if (namingServerAddressCache != null) {
            return namingServerAddressCache;
        }
        Map<String, AtomicInteger> availableNamingserverMap = new HashMap<>(AVAILABLE_NAMINGSERVER_MAP);
        List<String> availableNamingserverList = new ArrayList<>();
        for (Map.Entry<String, AtomicInteger> entry : availableNamingserverMap.entrySet()) {
            String namingServerAddress = entry.getKey();
            Integer numberOfFailures = entry.getValue().get();

            if (numberOfFailures < HEALTH_CHECK_THRESHOLD) {
                availableNamingserverList.add(namingServerAddress);
            }
        }
        if (availableNamingserverList.isEmpty()) {
            throw new NamingRegistryException("no available namingserver address!");
        } else {
            namingServerAddressCache = availableNamingserverList.get(ThreadLocalRandom.current().nextInt(availableNamingserverList.size()));
            return namingServerAddressCache;
        }

    }
@Test
    public void getNamingAddrTest() {
        NamingserverRegistryServiceImpl namingserverRegistryService = NamingserverRegistryServiceImpl.getInstance();
        String addr = namingserverRegistryService.getNamingAddr();
        assertEquals(addr, "127.0.0.1:8080");
    }