@Override
  public void execute(Context context) {
    try (CloseableIterator<DefaultIssue> issues = protoIssueCache.traverse()) {
      while (issues.hasNext()) {
        DefaultIssue issue = issues.next();
        if (shouldUpdateIndexForIssue(issue)) {
          changedIssuesRepository.addIssueKey(issue.key());
        }
      }
    }
  }
@Test
  public void execute_whenIssueIsToBeMigratedAsNewCodeReferenceIssue_shouldLoadIssue() {
    when(periodHolder.hasPeriod()).thenReturn(true);
    when(periodHolder.getPeriod()).thenReturn(new Period("REFERENCE_BRANCH", null, null));

    protoIssueCache.newAppender()
      .append(newDefaultIssue()
        .setIsOnChangedLine(true)
        .setIsNewCodeReferenceIssue(false)
        .setIsNoLongerNewCodeReferenceIssue(false)
        .setNew(false)
        .setCopied(false)
        .setChanged(false))
      .close();

    underTest.execute(mock(ComputationStep.Context.class));

    verify(changedIssuesRepository).addIssueKey("issueKey1");
  }