public static InetSocketAddress createInetSocketAddress(String hostname, int port, boolean resolve) {
		requireNonNull(hostname, "hostname");
		InetSocketAddress inetAddressForIpString = createForIpString(hostname, port);
		if (inetAddressForIpString != null) {
			return inetAddressForIpString;
		}
		else {
			return resolve ? new InetSocketAddress(hostname, port) : InetSocketAddress.createUnresolved(hostname, port);
		}
	}
@Test
	void createInetSocketAddressBadValues() {
		assertThatExceptionOfType(NullPointerException.class)
				.isThrownBy(() -> AddressUtils.createInetSocketAddress(null, 0, true))
				.withMessage("hostname");

		assertThatExceptionOfType(IllegalArgumentException.class)
				.isThrownBy(() -> AddressUtils.createInetSocketAddress("hostname", -1, true))
				.withMessage("port out of range:-1");
	}