public static boolean isUri(String potentialUri) {
        if (StringUtils.isBlank(potentialUri)) {
            return false;
        }

        try {
            URI uri = new URI(potentialUri);
            return uri.getScheme() != null && uri.getHost() != null;
        } catch (URISyntaxException e) {
            return false;
        }
    }
@Test public void
    returns_true_when_uri_contains_scheme_and_host() {
        assertThat(UriValidator.isUri("http://127.0.0.1"), is(true));
    }