public IssuesChangesNotification newIssuesChangesNotification(Set<DefaultIssue> issues, Map<String, UserDto> assigneesByUuid) {
    AnalysisChange change = new AnalysisChange(analysisMetadataHolder.getAnalysisDate());
    Set<ChangedIssue> changedIssues = issues.stream()
      .map(issue -> new ChangedIssue.Builder(issue.key())
        .setAssignee(getAssignee(issue.assignee(), assigneesByUuid))
        .setNewStatus(issue.status())
        .setNewIssueStatus(issue.status() != null ? IssueStatus.of(issue.status(), issue.resolution()) : null)
        .setRule(getRuleByRuleKey(issue.ruleKey()))
        .setProject(getProject())
        .build())
      .collect(Collectors.toSet());

    return issuesChangesSerializer.serialize(new IssuesChangesNotificationBuilder(changedIssues, change));
  }
@Test
  public void newIssuesChangesNotification_fails_with_ISE_if_analysis_date_has_not_been_set() {
    Set<DefaultIssue> issues = IntStream.range(0, 1 + new Random().nextInt(2))
      .mapToObj(i -> new DefaultIssue())
      .collect(Collectors.toSet());
    Map<String, UserDto> assigneesByUuid = nonEmptyAssigneesByUuid();

    assertThatThrownBy(() -> underTest.newIssuesChangesNotification(issues, assigneesByUuid))
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Analysis date has not been set");
  }