public static boolean isValidUrl(final String url) {
        try {
            String encodedURL = URLEncoder.encode(url, Charset.defaultCharset().name());
            return url.equals(encodedURL);
        } catch (UnsupportedEncodingException e) {
            return false;
        }
    }
@Test
    public void should_know_valid_url_character() {
        assertThat(URLs.isValidUrl("base"), is(true));
        assertThat(URLs.isValidUrl("base path"), is(false));
    }