public List<StashPullRequestComment> getPullRequestComments(
      String projectCode, String commentRepositoryName, String pullRequestId) {

    try {
      boolean isLastPage = false;
      int start = 0;
      List<StashPullRequestActivityResponse> commentResponses =
          new ArrayList<StashPullRequestActivityResponse>();
      while (!isLastPage) {
        String response =
            getRequest(
                apiBaseUrl
                    + projectCode
                    + "/repos/"
                    + commentRepositoryName
                    + "/pull-requests/"
                    + pullRequestId
                    + "/activities?start="
                    + start);
        StashPullRequestActivityResponse resp = parseCommentJson(response);
        isLastPage = resp.getIsLastPage();
        if (!isLastPage) {
          start = resp.getNextPageStart();
        }
        commentResponses.add(resp);
      }
      return extractComments(commentResponses);
    } catch (Exception e) {
      logger.log(Level.WARNING, "invalid pull request response.", e);
    }
    return Collections.EMPTY_LIST;
  }
 private List<StashPullRequestComment> extractComments(
     List<StashPullRequestActivityResponse> responses) {
   List<StashPullRequestComment> comments = new ArrayList<StashPullRequestComment>();
   for (StashPullRequestActivityResponse parsedResponse : responses) {
     for (StashPullRequestActivity a : parsedResponse.getPrValues()) {
       if (a != null && a.getComment() != null) comments.add(a.getComment());
     }
   }
   return comments;
 }