HttpUtil { public static URI buildUri(String uri) { try { return new URI(uri); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid URI: " + uri, e); } } private  HttpUtil(); static URI buildUri(String uri); static Instant parseHttpDate(String dateText); static String formatHttpDate(Instant instant); static String concatPaths(String... paths); static Multimap<String, String> toMultimap(String... params); static HttpRequest built(HttpRequestOrBuilder rob); static HttpRequest.Builder builder(HttpRequestOrBuilder rob); static HttpResponse built(HttpResponseOrBuilder rob); static HttpResponse.Builder builder(HttpResponseOrBuilder rob); static Cookie built(CookieOrBuilder cookieOrBuilder); static Cookie.Builder builder(CookieOrBuilder cob); static String readContentString(HttpMessage msg); static final DateTimeFormatter HTTP_DATE_FORMAT; }
@Test public void buildUri() { HttpUtil.buildUri("http: }
@Test(expected = IllegalArgumentException.class) public void buildUri_bad() { HttpUtil.buildUri("this is not a uri"); }