public void removeProfileFromIndexSets(final Set<String> indexSetsIds,
                                           final boolean rotateImmediately) {
        for (String indexSetId : indexSetsIds) {
            try {
                indexSetService.get(indexSetId).ifPresent(indexSetConfig -> {
                    var updatedIndexSetConfig = removeProfileFromIndexSet(indexSetConfig);
                    if (rotateImmediately) {
                        updatedIndexSetConfig.ifPresent(this::cycleIndexSet);
                    }
                });
            } catch (Exception ex) {
                LOG.error("Failed to update field type in index set : " + indexSetId, ex);
                throw ex;
            }
        }
    }
@Test
    void testRemovesProfile() {
        existingIndexSet = existingIndexSet.toBuilder()
                .fieldTypeProfile("000000000000000000000042")
                .build();
        doReturn(Optional.of(existingIndexSet)).when(indexSetService).get("existing_index_set");
        toTest.removeProfileFromIndexSets(Set.of(existingIndexSet.id()), false);

        verify(mongoIndexSetService).save(
                existingIndexSet.toBuilder()
                        .fieldTypeProfile(null)
                        .build());
        verifyNoInteractions(existingMongoIndexSet);
    }