public boolean hasProjectSubscribersForTypes(String projectUuid, Set<Class<? extends Notification>> notificationTypes) {
    Set<String> dispatcherKeys = handlers.stream()
      .filter(handler -> notificationTypes.stream().anyMatch(notificationType -> handler.getNotificationClass() == notificationType))
      .map(NotificationHandler::getMetadata)
      .filter(Optional::isPresent)
      .map(Optional::get)
      .map(NotificationDispatcherMetadata::getDispatcherKey)
      .collect(Collectors.toSet());

    return dbClient.propertiesDao().hasProjectNotificationSubscribersForDispatchers(projectUuid, dispatcherKeys);
  }
@Test
  public void hasProjectSubscribersForType_returns_false_if_there_are_no_handler() {
    String projectUuid = randomAlphabetic(7);
    NotificationService underTest = new NotificationService(dbClient);

    assertThat(underTest.hasProjectSubscribersForTypes(projectUuid, ImmutableSet.of(Notification1.class))).isFalse();
    assertThat(underTest.hasProjectSubscribersForTypes(projectUuid, ImmutableSet.of(Notification2.class))).isFalse();
  }