@Override
    public void validateNameUniqueness(Map<CaseInsensitiveString, AbstractMaterialConfig> map) {
        if (StringUtils.isBlank(scmId)) {
            return;
        }
        if (map.containsKey(new CaseInsensitiveString(scmId))) {
            AbstractMaterialConfig material = map.get(new CaseInsensitiveString(scmId));
            material.addError(SCM_ID, "Duplicate SCM material detected!");
            addError(SCM_ID, "Duplicate SCM material detected!");
        } else {
            map.put(new CaseInsensitiveString(scmId), this);
        }
    }
@Test
    public void shouldPassMaterialUniquenessIfIfNoDuplicateSCMFound() {
        Map<CaseInsensitiveString, AbstractMaterialConfig> nameToMaterialMap = new HashMap<>();
        nameToMaterialMap.put(new CaseInsensitiveString("scm-id-new"), new PluggableSCMMaterialConfig("scm-id-new"));
        nameToMaterialMap.put(new CaseInsensitiveString("foo"), git("url"));

        pluggableSCMMaterialConfig.validateNameUniqueness(nameToMaterialMap);

        assertThat(pluggableSCMMaterialConfig.errors().getAll().size(), is(0));
        assertThat(nameToMaterialMap.size(), is(3));
    }