public BranchesList getBranches(String serverUrl, String token, String projectSlug, String repositorySlug) {
    HttpUrl url = buildUrl(serverUrl, format("/rest/api/1.0/projects/%s/repos/%s/branches", projectSlug, repositorySlug));
    return doGet(token, url, body -> buildGson().fromJson(body, BranchesList.class));
  }
@Test
  public void getBranches_given0Branches_returnEmptyList() {
    String bodyWith0Branches = "{\n" +
      "  \"size\": 0,\n" +
      "  \"limit\": 25,\n" +
      "  \"isLastPage\": true,\n" +
      "  \"values\": [],\n" +
      "  \"start\": 0\n" +
      "}";
    server.enqueue(new MockResponse()
      .setHeader("Content-Type", "application/json;charset=UTF-8")
      .setBody(bodyWith0Branches));

    BranchesList branches = underTest.getBranches(server.url("/").toString(), "token", "projectSlug", "repoSlug");

    assertThat(branches.getBranches()).isEmpty();
  }