    @Test
    public void testContainsChar() {

        // version 1 format (Strings)
        CharacterSet set = new CharacterSet();
        set.add(new CharacterRange("ABC"));
        set.add(new CharacterRange("XyZ"));
        assertTrue("A", set.contains("A".codePointAt(0)));
        assertTrue("B", set.contains("B".codePointAt(0)));
        assertTrue("C", set.contains("C".codePointAt(0)));
        assertTrue("X", set.contains("X".codePointAt(0)));
        assertTrue("y", set.contains("y".codePointAt(0)));
        assertTrue("Z", set.contains("Z".codePointAt(0)));
        assertFalse("a", set.contains("a".codePointAt(0)));
        assertFalse("Y", set.contains("Y".codePointAt(0)));
        assertFalse("P", set.contains("P".codePointAt(0)));
        
        // version 5 format (ranges)
        set = new CharacterSet();
        set.add(new CharacterRange(65, 67));   // A..C
        set.add(new CharacterRange(88, 88));   // X
        set.add(new CharacterRange(121, 121)); // y
        set.add(new CharacterRange(90, 90));   // Z
        assertTrue("A", set.contains("A".codePointAt(0)));
        assertTrue("B", set.contains("B".codePointAt(0)));
        assertTrue("C", set.contains("C".codePointAt(0)));
        assertTrue("X", set.contains("X".codePointAt(0)));
        assertTrue("y", set.contains("y".codePointAt(0)));
        assertTrue("Z", set.contains("Z".codePointAt(0)));
        assertFalse("a", set.contains("a".codePointAt(0)));
        assertFalse("Y", set.contains("Y".codePointAt(0)));
        assertFalse("P", set.contains("P".codePointAt(0)));        
    }