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_false_when_uri_is_empty() {
        assertThat(UriValidator.isUri(""), is(false));
    }