public void changeFieldType(final CustomFieldMapping customMapping,
                                final Set<String> indexSetsIds,
                                final boolean rotateImmediately) {
        checkFieldTypeCanBeChanged(customMapping.fieldName());
        checkType(customMapping);
        checkAllIndicesSupportFieldTypeChange(customMapping.fieldName(), indexSetsIds);

        for (String indexSetId : indexSetsIds) {
            try {
                indexSetService.get(indexSetId).ifPresent(indexSetConfig -> {
                    var updatedIndexSetConfig = storeMapping(customMapping, 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 testDoesNotCycleIndexSetWhenMappingAlreadyExisted() {
        doReturn(Optional.of(existingIndexSet)).when(indexSetService).get("existing_index_set");
        toTest.changeFieldType(existingCustomFieldMapping,
                new LinkedHashSet<>(List.of("existing_index_set", "wrong_index_set")),
                true);

        verify(existingMongoIndexSet, never()).cycle();
        verifyNoMoreInteractions(mongoIndexSetService);
    }