protected static HttpUrl buildUrl(@Nullable String serverUrl, String relativeUrl) {
    if (serverUrl == null || !(serverUrl.toLowerCase(ENGLISH).startsWith("http://") || serverUrl.toLowerCase(ENGLISH).startsWith("https://"))) {
      throw new IllegalArgumentException("url must start with http:// or https://");
    }
    return HttpUrl.parse(removeEnd(serverUrl, "/") + relativeUrl);
  }
@Test
  public void invalid_empty_url() {
    assertThatThrownBy(() -> BitbucketServerRestClient.buildUrl(null, ""))
            .isInstanceOf(IllegalArgumentException.class)
            .hasMessage("url must start with http:// or https://");
  }