/*
 *  @author Ranides Atterwim <ranides@gmail.com>
 *  @copyright Ranides Atterwim
 *  @license WTFPL
 *  @url http://ranides.net/projects/assira
 */

package net.ranides.assira.collection.set;

import java.util.Arrays;
import java.util.Set;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author ranides
 */
public class IdentitySetTest {
    
    public IdentitySetTest() {
    }

    @Test
    public void testSomeMethod() {
        // character to dobre elementy do testowania, bo <127 są zawsze te same
        // i mają małe hashcode'y
        Set<Character> chars = new IdentitySet<>();
        
        int count = 0;
        for(char a='a'; a<'z'; a++) {
            chars.add(a);
            chars.add(Character.toUpperCase(a));
            count += 2;
        }
        
        assertTrue( chars.contains('Q'));
        assertTrue( chars.contains('q'));
        assertEquals( count, chars.size() );
        
        chars.remove('a');
        chars.remove('q');
        chars.removeAll(Arrays.asList('c','d','e','0','1'));
        
        assertFalse( chars.contains('a'));
        assertFalse( chars.contains('q'));
        assertFalse( chars.contains('c'));
        
        
        assertTrue(true);
    }
}
