@Test public void testResolver() throws Exception { InetAddress address = nameResolver.resolve("www.google.com"); Assert.assertNotNull(address); }
@Override public InetAddress resolve(String name) throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(name); int addressIdx = ThreadLocalRandom.current().nextInt(addresses.length); return addresses[addressIdx]; }
RandomNameResolver implements ParsecNameResolver { @Override public InetAddress resolve(String name) throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(name); int addressIdx = ThreadLocalRandom.current().nextInt(addresses.length); return addresses[addressIdx]; } }
RandomNameResolver implements ParsecNameResolver { @Override public InetAddress resolve(String name) throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(name); int addressIdx = ThreadLocalRandom.current().nextInt(addresses.length); return addresses[addressIdx]; }  }
RandomNameResolver implements ParsecNameResolver { @Override public InetAddress resolve(String name) throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(name); int addressIdx = ThreadLocalRandom.current().nextInt(addresses.length); return addresses[addressIdx]; }  @Override InetAddress resolve(String name); }
RandomNameResolver implements ParsecNameResolver { @Override public InetAddress resolve(String name) throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(name); int addressIdx = ThreadLocalRandom.current().nextInt(addresses.length); return addresses[addressIdx]; }  @Override InetAddress resolve(String name);  }