public Map<String, Set<String>> usagesOfProfiles(final Set<String> profilesIds) {
        Map<String, Set<String>> usagesInIndexSet = new HashMap<>();
        profilesIds.forEach(profId -> usagesInIndexSet.put(profId, new HashSet<>()));
        indexSetsCollection
                .find(Filters.in(FIELD_PROFILE_ID,
                        profilesIds.stream()
                                .filter(ObjectId::isValid)
                                .toList()))
                .projection(Projections.include(INDEX_SET_ID, FIELD_PROFILE_ID))
                .forEach(document -> {
                    final String indexSetId = document.getObjectId(INDEX_SET_ID).toString();
                    final String profileId = document.getString(FIELD_PROFILE_ID);
                    usagesInIndexSet.get(profileId).add(indexSetId);
                });

        return usagesInIndexSet;
    }
@Test
    public void testReturnsProperUsagesForMultipleProfiles() {
        Map<String, Set<String>> expectedResult = Map.of(
                PROFILE1_ID, Set.of("000000000000000000000001", "000000000000000000000011"),
                PROFILE2_ID, Set.of("000000000000000000000002"),
                UNUSED_PROFILE_ID, Set.of(),
                WRONG_PROFILE_ID, Set.of()
        );

        assertEquals(expectedResult, toTest.usagesOfProfiles(Set.of(PROFILE1_ID, PROFILE2_ID, UNUSED_PROFILE_ID, WRONG_PROFILE_ID)));
    }