Urls { @NonNull public static HttpUrl addPathToUrl(@NonNull HttpUrl url, @NonNull String path) { HttpUrl.Builder builder = url.newBuilder(); String[] segments = path.split("/"); for (String segment : segments) { builder.addPathSegment(segment); } return builder.build(); } private  Urls(); @NonNull static HttpUrl addPathToUrl(@NonNull HttpUrl url, @NonNull String path); @Nullable static String getTranscodeUrl(@NonNull HttpUrl url, @Nullable String imageKey); @Nullable static String addTranscodeParams(@Nullable String transcodeUrl, int width, int height);  }
@Test public void addPathToUrl() { String expected = "https: HttpUrl url = Urls.addPathToUrl(HttpUrl.parse("https: String actual = url.toString(); assertThat(actual, is(expected)); }