@SuppressWarnings("JavaReflectionMemberAccess")
	static void set(NameServiceProxy dns) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException {
		Class<?> inetAddressClass = InetAddress.class;
		Object proxyInstance;
		Field nameServiceField;
		try {
			// for JDK 9 or above.
			Class<?> originNameServiceInterface = forName("java.net.InetAddress$NameService");
			nameServiceField = inetAddressClass.getDeclaredField("nameService");
			proxyInstance = newProxyInstance(originNameServiceInterface.getClassLoader(),
				new Class<?>[] { originNameServiceInterface }, dns);
		} catch (ClassNotFoundException | NoSuchFieldException e) {
			// for JDK 8 or less.
			Class<?> originNameServiceInterface = forName("sun.net.spi.nameservice.NameService");
			nameServiceField = inetAddressClass.getDeclaredField("nameServices");
			proxyInstance = singletonList(newProxyInstance(originNameServiceInterface.getClassLoader(),
				new Class<?>[] { originNameServiceInterface }, dns));
		}
		nameServiceField.setAccessible(true);
		nameServiceField.set(inetAddressClass, proxyInstance);
		nameServiceField.setAccessible(false);
	}
@param dns NameService implementation to be replaced.
Replace NameService implementation of {@link InetAddress}.
ngrinder-runtime/src/main/java/org/ngrinder/dns/NameServiceProxy.java