public static SocketAddress updateHost(@Nullable Supplier<? extends SocketAddress> address, String host) {
		if (address == null) {
			return createUnresolved(host, 0);
		}

		SocketAddress socketAddress = address.get();
		if (socketAddress instanceof DomainSocketAddress) {
			throw new IllegalArgumentException("Cannot update DomainSocketAddress with host name [" + host + "].");
		}

		if (!(socketAddress instanceof InetSocketAddress)) {
			return createUnresolved(host, 0);
		}

		InetSocketAddress inet = (InetSocketAddress) socketAddress;

		return createUnresolved(host, inet.getPort());
	}
@Test
	void updateHostBadValues() {
		assertThatExceptionOfType(NullPointerException.class)
				.isThrownBy(() -> AddressUtils.updateHost(null, null))
				.withMessage("hostname");
	}