@Bean("ProjectBranches")
  public ProjectBranches provide(@Nullable ProjectBranchesLoader loader, ScannerProperties scannerProperties) {
    if (loader == null) {
      return new ProjectBranches(Collections.emptyList());
    }

    Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
    ProjectBranches branches = loader.load(scannerProperties.getProjectKey());
    profiler.stopInfo();
    return branches;
  }
@Test
  public void should_use_loader() {
    when(scannerProperties.getProjectKey()).thenReturn("key");
    when(mockLoader.load("key")).thenReturn(mockBranches);
    ProjectBranches branches = provider.provide(mockLoader, scannerProperties);

    assertThat(branches).isSameAs(mockBranches);
  }