public IssueDto resolve(DefaultIssue issue, IssueDto dbIssue) {
    LOG.debug("Resolve conflict on issue {}", issue.key());
    mergeFields(dbIssue, issue);
    return IssueDto.toDtoForUpdate(issue, System.currentTimeMillis());
  }
@Test
  public void should_reload_issue_and_resolve_conflict() {
    DefaultIssue issue = new DefaultIssue()
      .setKey("ABCDE")
      .setType(CODE_SMELL)
      .setRuleKey(RuleKey.of("java", "AvoidCycles"))
      .setProjectUuid("U1")
      .setComponentUuid("U2")
      .addImpact(SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.HIGH)
      .setNew(false)
      .setStatus(STATUS_OPEN);

    // Issue as seen and changed by end-user
    IssueDto issueDto = new IssueDto()
      .setKee("ABCDE")
      .setType(CODE_SMELL)
      .setRuleUuid("uuid-10")
      .setRuleKey("java", "AvoidCycles")
      .setProjectUuid("U1")
      .setComponentUuid("U2")
      .addImpact(new ImpactDto(SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.HIGH))
      .setLine(10)
      .setStatus(STATUS_OPEN)

      // field changed by user
      .setAssigneeUuid("arthur-uuid");

    IssueDto updatedIssue = underTest.resolve(issue, issueDto);
    assertThat(updatedIssue.getKee()).isEqualTo("ABCDE");
    assertThat(updatedIssue.getAssigneeUuid()).isEqualTo("arthur-uuid");
    assertThat(updatedIssue.getImpacts())
      .extracting(ImpactDto::getSoftwareQuality, ImpactDto::getSeverity)
      .containsExactlyInAnyOrder(Tuple.tuple(SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.HIGH));
  }