public boolean setCodeVariants(DefaultIssue issue, Set<String> currentCodeVariants, IssueChangeContext context) {
    Set<String> newCodeVariants = getNewCodeVariants(issue);
    if (!currentCodeVariants.equals(newCodeVariants)) {
      issue.setFieldChange(context, CODE_VARIANTS,
        currentCodeVariants.isEmpty() ? null : CHANGELOG_LIST_JOINER.join(currentCodeVariants),
        newCodeVariants.isEmpty() ? null : CHANGELOG_LIST_JOINER.join(newCodeVariants));
      issue.setCodeVariants(newCodeVariants);
      issue.setUpdateDate(context.date());
      issue.setChanged(true);
      issue.setSendNotifications(true);
      return true;
    }
    return false;
  }
@Test
  void setCodeVariants_whenCodeVariantsUnchanged_shouldNotBeUpdated() {
    Set<String> currentCodeVariants = new HashSet<>(Arrays.asList("linux", "windows"));
    Set<String> newCodeVariants = new HashSet<>(Arrays.asList("windows", "linux"));

    issue.setCodeVariants(newCodeVariants);
    boolean updated = underTest.setCodeVariants(issue, currentCodeVariants, context);
    assertThat(updated).isFalse();
    assertThat(issue.currentChange()).isNull();
  }