@Override
  public void onProjectBranchesChanged(Set<Project> projects, Set<String> impactedBranches) {
    checkNotNull(projects, "projects can't be null");
    if (projects.isEmpty()) {
      return;
    }

    Arrays.stream(listeners)
      .forEach(safelyCallListener(listener -> listener.onProjectBranchesChanged(projects, impactedBranches)));
  }
@Test
  @UseDataProvider("oneOrManyProjects")
  public void onProjectBranchesChanged_calls_all_listeners_even_if_one_throws_an_Exception(Set<Project> projects) {
    InOrder inOrder = Mockito.inOrder(listener1, listener2, listener3);
    doThrow(new RuntimeException("Faking listener2 throwing an exception"))
      .when(listener2)
      .onProjectBranchesChanged(any(), anySet());

    underTestWithListeners.onProjectBranchesChanged(projects, emptySet());

    inOrder.verify(listener1).onProjectBranchesChanged(same(projects), eq(emptySet()));
    inOrder.verify(listener2).onProjectBranchesChanged(same(projects), eq(emptySet()));
    inOrder.verify(listener3).onProjectBranchesChanged(same(projects), eq(emptySet()));
    inOrder.verifyNoMoreInteractions();
  }