DnsCacheManipulator { @Nullable public static DnsCacheEntry getDnsCache(String host) { try { return InetAddressCacheUtil.getInetAddressCache(host); } catch (Exception e) { throw new DnsCacheManipulatorException("Fail to getDnsCache, cause: " + e.toString(), e); } } private  DnsCacheManipulator(); static void setDnsCache(String host, String... ips); static void setDnsCache(long expireMillis, String host, String... ips); static void setDnsCache(Properties properties); static void loadDnsCacheConfig(); static void loadDnsCacheConfig(String propertiesFileName); @Nullable static DnsCacheEntry getDnsCache(String host); @Deprecated static List<DnsCacheEntry> getAllDnsCache(); static List<DnsCacheEntry> listDnsCache(); static DnsCache getWholeDnsCache(); static void removeDnsCache(String host); static void clearDnsCache(); static int getDnsCachePolicy(); static void setDnsCachePolicy(int cacheSeconds); static int getDnsNegativeCachePolicy(); static void setDnsNegativeCachePolicy(int negativeCacheSeconds);  }
@Test public void test_nullSafeForGetDnsCache() throws Exception { final DnsCacheEntry dnsCache = DnsCacheManipulator.getDnsCache(DOMAIN_NOT_EXISTED); assertNull(dnsCache); }