public static HostInfo buildFromEndpoint(final String endPoint) {
        if (Utils.isBlank(endPoint)) {
            return null;
        }

        final String host = getHost(endPoint);
        final Integer port = getPort(endPoint);

        if (host == null || port == null) {
            throw new ConfigException(
                String.format("Error parsing host address %s. Expected format host:port.", endPoint)
            );
        }
        return new HostInfo(host, port);
    }
@Test
    public void shouldThrowConfigExceptionForNonsenseEndPoint() {
        assertThrows(ConfigException.class, () -> HostInfo.buildFromEndpoint("nonsense"));
    }