private void testSpecialCharacterInAttribute(char character, int position, String filtertype, boolean allowed) {
        String attribute = "";
        String posName = "";
        switch (position) {
            case 1: attribute = character + "cn"; posName = "first"; break;
            case 2: attribute = "c" + character + "n"; posName = "middle"; break;
            case 3: attribute = "cn" + character; posName = "last"; break;
        }

        String filter = "(" + attribute + filtertype+"a)";
        try {
            m_context.createFilter(filter).match(dict);
            assert allowed : "Character '" + character + "' should not be allowable in "+posName+" position in attributes with operator "+filtertype+". Filter = " + filter + ".";
        }
        catch (InvalidSyntaxException e) {
            assert !allowed : "Character '" + character + "' should be allowable in "+posName+" position in attributes with operator "+filtertype+". Filter = " + filter + ". Exception = " + e.getMessage();
        }
    }