public static Map<String, ServiceInfo> read(String cacheDir) {
        Map<String, ServiceInfo> domMap = new HashMap<>(16);
        try {
            File[] files = makeSureCacheDirExists(cacheDir).listFiles();
            if (files == null || files.length == 0) {
                return domMap;
            }
            
            for (File file : files) {
                if (!file.isFile()) {
                    continue;
                }
                domMap.putAll(parseServiceInfoFromCache(file));
            }
        } catch (Throwable e) {
            NAMING_LOGGER.error("[NA] failed to read cache file", e);
        }
        
        return domMap;
    }
@Test
    void testReadCacheForAllSituation() {
        String dir = DiskCacheTest.class.getResource("/").getPath() + "/disk_cache_test";
        Map<String, ServiceInfo> actual = DiskCache.read(dir);
        assertEquals(2, actual.size());
        assertTrue(actual.containsKey("legal@@no_name@@file"));
        assertEquals("1.1.1.1", actual.get("legal@@no_name@@file").getHosts().get(0).getIp());
        assertTrue(actual.containsKey("legal@@with_name@@file"));
        assertEquals("1.1.1.1", actual.get("legal@@with_name@@file").getHosts().get(0).getIp());
    }