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_issue_has_assignee_not_in_assigneesByUuid() {
    RuleKey ruleKey = RuleKey.of("foo", "bar");
    String assigneeUuid = randomAlphabetic(40);
    DefaultIssue issue = new DefaultIssue()
      .setRuleKey(ruleKey)
      .setKey("issueKey")
      .setStatus(STATUS_OPEN)
      .setAssigneeUuid(assigneeUuid);
    Map<String, UserDto> assigneesByUuid = Collections.emptyMap();
    ReportComponent project = ReportComponent.builder(PROJECT, 1).build();
    ruleRepository.add(ruleKey);
    treeRootHolder.setRoot(project);
    analysisMetadata.setAnalysisDate(new Random().nextLong());
    analysisMetadata.setBranch(newNonMainBranch(BranchType.BRANCH, randomAlphabetic(12)));

    assertThatThrownBy(() ->  underTest.newIssuesChangesNotification(ImmutableSet.of(issue), assigneesByUuid))
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Can not find DTO for assignee uuid " + assigneeUuid);
  }