@Test
    public void testSmallEmptySet() {
        final TinyIdentitySet<Integer> t = new TinyIdentitySet<>(3);
        Integer a = 0;
        Integer b = 1;
        Integer c = 2;
        t.add(a);
        t.add(b);
        t.add(c);
        assertEquals(3, t.size());
        t.remove(a);
        assertEquals(2, t.size());
        t.remove(c);
        assertEquals(1, t.size());
        t.remove(c);
        assertEquals(1, t.size());
        t.remove(b);
        assertEquals(0, t.size());
        t.add(b);
        assertEquals(1, t.size());
        t.add(b);
        assertEquals(1, t.size());
        t.add(a);
        assertEquals(2, t.size());
        t.add(a);
        assertEquals(2, t.size());
        t.add(c);
        assertEquals(3, t.size());
        t.add(c);
        assertEquals(3, t.size());
    }
Check TinyIdentitySet seems to work. :)

@author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
vespajlib/src/test/java/com/yahoo/collections/TinyIdentitySetTestCase.java