@Override
  public void onProjectsRekeyed(Set<RekeyedProject> rekeyedProjects) {
    checkNotNull(rekeyedProjects, "rekeyedProjects can't be null");
    if (rekeyedProjects.isEmpty()) {
      return;
    }

    Arrays.stream(listeners)
      .forEach(safelyCallListener(listener -> listener.onProjectsRekeyed(rekeyedProjects)));
  }
@Test
  @UseDataProvider("oneOrManyRekeyedProjects")
  public void onProjectsRekeyed_calls_all_listeners_even_if_one_throws_an_Exception(Set<RekeyedProject> projects) {
    InOrder inOrder = Mockito.inOrder(listener1, listener2, listener3);
    doThrow(new RuntimeException("Faking listener2 throwing an exception"))
      .when(listener2)
      .onProjectsRekeyed(any());

    underTestWithListeners.onProjectsRekeyed(projects);

    inOrder.verify(listener1).onProjectsRekeyed(same(projects));
    inOrder.verify(listener2).onProjectsRekeyed(same(projects));
    inOrder.verify(listener3).onProjectsRekeyed(same(projects));
    inOrder.verifyNoMoreInteractions();
  }