@Override
  public Map<String, Boolean> getGroupUuidToManaged(DbSession dbSession, Set<String> groupUuids) {
    return findManagedInstanceService()
      .map(managedInstanceService -> managedInstanceService.getGroupUuidToManaged(dbSession, groupUuids))
      .orElse(returnNonManagedForAll(groupUuids));
  }
@Test
  public void getGroupUuidToManaged_ifMoreThanOneDelegatesActivated_throws() {
    Set<ManagedInstanceService> managedInstanceServices = Set.of(new AlwaysManagedInstanceService(), new AlwaysManagedInstanceService());
    DelegatingManagedServices delegatingManagedServices = new DelegatingManagedServices(managedInstanceServices);
    assertThatIllegalStateException()
      .isThrownBy(() -> delegatingManagedServices.getGroupUuidToManaged(dbSession, Set.of("a")))
      .withMessage("The instance can't be managed by more than one identity provider and 2 were found.");
  }