@Bean("BranchConfiguration")
  public BranchConfiguration provide(@Nullable BranchConfigurationLoader loader, ProjectConfiguration projectConfiguration, ProjectBranches branches) {
    if (loader == null) {
      return new DefaultBranchConfiguration();
    } else {
      Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
      BranchConfiguration branchConfiguration = loader.load(projectConfiguration.getProperties(), branches);
      profiler.stopInfo();
      return branchConfiguration;
    }
  }
@Test
  public void should_use_loader() {
    when(loader.load(eq(projectSettings), eq(branches))).thenReturn(config);

    BranchConfiguration result = provider.provide(loader, projectConfiguration, branches);

    assertThat(result).isSameAs(config);
  }