DNS { public synchronized String resolve(String host){ String addr = resolved.get(host); if(addr != null){ return addr; } if(EvoIPAddressUtil.textToNumericFormatV4(host) != null){ return host; } if(counter.get() > 255){ return null; } addr = MASK + counter.getAndIncrement(); resolved.put(host, addr); return addr; } DNS(); synchronized String resolve(String host);  }
@Test public void testResolve(){ DNS dns = new DNS(); String lbAddr = "127.0.0.1"; String lb = dns.resolve(lbAddr); String google = dns.resolve("www.google.com"); String evosuite = dns.resolve("www.evosuite.org"); Assert.assertEquals(lbAddr,lb); Assert.assertNotNull(google); Assert.assertNotNull(evosuite); Assert.assertNotEquals(lb,google); Assert.assertNotEquals(lb,evosuite); Assert.assertNotEquals(google,evosuite); }