public boolean isNew(Component component, DefaultIssue issue) {
    if (analysisMetadataHolder.isPullRequest()) {
      return true;
    }

    if (periodHolder.hasPeriod()) {
      if (periodHolder.hasPeriodDate()) {
        return periodHolder.getPeriod().isOnPeriod(issue.creationDate());
      }

      if (isOnBranchUsingReferenceBranch()) {
        return hasAtLeastOneLocationOnChangedLines(component, issue);
      }
    }
    return false;
  }
@Test
  public void isNew_returns_true_if_issue_is_on_period() {
    periodHolder.setPeriod(new Period(NewCodePeriodType.NUMBER_OF_DAYS.name(), "10", 1000L));
    DefaultIssue issue = mock(DefaultIssue.class);
    when(issue.creationDate()).thenReturn(new Date(2000L));
    assertThat(newIssueClassifier.isNew(mock(Component.class), issue)).isTrue();
    verify(issue).creationDate();
    verifyNoMoreInteractions(issue);
  }