public boolean isUniqueRoleName(final CaseInsensitiveString roleName) {
        return Collections.frequency(roleNames(), roleName) <= 1;
    }
@Test
    public void isUniqueRoleName_shouldBeFalseWithMultipleRolesWithSameName() throws Exception {
        RolesConfig rolesConfig = new RolesConfig(new RoleConfig(new CaseInsensitiveString("admin")),
                new RoleConfig(new CaseInsensitiveString("view")),
                new RoleConfig(new CaseInsensitiveString("view")));

        assertFalse(rolesConfig.isUniqueRoleName(new CaseInsensitiveString("view")));
    }