public boolean assign(DefaultIssue issue, @Nullable UserDto user, IssueChangeContext context) {
    String assigneeUuid = user != null ? user.getUuid() : null;
    if (!Objects.equals(assigneeUuid, issue.assignee())) {
      String newAssigneeName = user == null ? null : user.getName();
      issue.setFieldChange(context, ASSIGNEE, UNUSED, newAssigneeName);
      issue.setAssigneeUuid(user != null ? user.getUuid() : null);
      issue.setUpdateDate(context.date());
      issue.setChanged(true);
      issue.setSendNotifications(true);
      return true;
    }
    return false;
  }
@Test
  void assign() {
    UserDto user = newUserDto().setLogin("emmerik").setName("Emmerik");

    boolean updated = underTest.assign(issue, user, context);
    assertThat(updated).isTrue();
    assertThat(issue.assignee()).isEqualTo(user.getUuid());
    assertThat(issue.mustSendNotifications()).isTrue();
    FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
    assertThat(diff.oldValue()).isEqualTo(UNUSED);
    assertThat(diff.newValue()).isEqualTo(user.getName());
  }