@CheckForNull
  public String get() {
    // branches will be empty in CE
    if (branchConfiguration.isPullRequest() || branches.isEmpty()) {
      return null;
    }

    return Optional.ofNullable(getFromProperties()).orElseGet(this::loadWs);
  }
@Test
  public void get_uses_scanner_property_with_higher_priority() {
    when(branchConfiguration.branchType()).thenReturn(BranchType.BRANCH);
    when(branchConfiguration.branchName()).thenReturn(BRANCH_KEY);
    when(newCodePeriodLoader.load(PROJECT_KEY, BRANCH_KEY)).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "main"));

    when(configuration.get("sonar.newCode.referenceBranch")).thenReturn(Optional.of("master2"));

    assertThat(referenceBranchSupplier.get()).isEqualTo("master2");
  }