public void commentIssue(
     String repositoryName, User user, Collection<Commit> commits, String issue) {
   if (jiraService.isExistingIssue(issue)) {
     commits.forEach(
         commit -> {
           if (!jiraService.isIssueAlreadyCommented(issue, commit.getId())) {
             try {
               log.info("Comment issue <{}> for commit <{}>", issue, commit);
               if (!jiraService.performTransition(
                   commit.getMessage(),
                   issue,
                   buildCommentForTransition(user, repositoryName, commit))) {
                 jiraService.commentIssue(
                     issue, new Comment(buildComment(user, repositoryName, commit)));
               }
             } catch (IOException e) {
               log.error("Unable to comment issue <{}>", issue, e);
             }
           } else {
             log.warn(
                 "Issue <{}> has already been commented for commit <{}>", issue, commit.getId());
           }
         });
   } else {
     log.warn("Issue <{}> has been mentioned, but does not exists", issue);
   }
 }
  public void performPushEvent(Event event) {
    Preconditions.checkNotNull(event.getCommits(), "commits array can not be null");
    // For each commit, extract jira issues
    Multimap<String, Commit> jiraIssues = ArrayListMultimap.create();
    event
        .getCommits()
        .forEach(
            commit ->
                jiraService
                    .extractIssuesFromMessage(commit.getMessage())
                    .forEach(issue -> jiraIssues.put(issue, commit)));

    if (jiraIssues.size() > 0) {
      User user = getUser(event);

      jiraIssues
          .asMap()
          .forEach(
              (issue, commits) ->
                  commentIssue(event.getRepository().getName(), user, commits, issue));
    }
  }