public Optional<Violation> validate(IndexSetConfig newConfig) {

        // Don't validate prefix conflicts in case of an update
        if (Strings.isNullOrEmpty(newConfig.id())) {
            final Violation prefixViolation = validatePrefix(newConfig);
            if (prefixViolation != null) {
                return Optional.of(prefixViolation);
            }
        }

        final Violation fieldMappingViolation = validateMappingChangesAreLegal(newConfig);
        if (fieldMappingViolation != null) {
            return Optional.of(fieldMappingViolation);
        }

        Violation refreshIntervalViolation = validateSimpleIndexSetConfig(newConfig);
        if (refreshIntervalViolation != null){
            return Optional.of(refreshIntervalViolation);
        }
        return Optional.empty();
    }
@Test
    public void testStrategiesPresentIfDataTiersIsNull() {
        final IndexSet indexSet = mock(IndexSet.class);
        when(indexSet.getIndexPrefix()).thenReturn("foo");
        when(indexSetRegistry.iterator()).thenReturn(Collections.singleton(indexSet).iterator());


        assertThat(validator.validate(testIndexSetConfig().toBuilder().retentionStrategyConfig(null).build())).hasValueSatisfying(v ->
                assertThat(v.message()).contains("retention_strategy cannot be null")
        );
        assertThat(validator.validate(testIndexSetConfig().toBuilder().retentionStrategyClass(null).build())).hasValueSatisfying(v ->
                assertThat(v.message()).contains("retention_strategy_class cannot be null")
        );
        assertThat(validator.validate(testIndexSetConfig().toBuilder().rotationStrategyConfig(null).build())).hasValueSatisfying(v ->
                assertThat(v.message()).contains("rotation_strategy cannot be null")
        );
        assertThat(validator.validate(testIndexSetConfig().toBuilder().rotationStrategyClass(null).build())).hasValueSatisfying(v ->
                assertThat(v.message()).contains("rotation_strategy_class cannot be null")
        );
    }