@Test
    public void testToArrayTArray() {
        final List<String> stuff = doubleAdd();
        final ArraySet<String> t = new ArraySet<>(
                stuff.size());
        t.addAll(stuff);
        final String[] s = t.toArray(new String[0]);
        assertEquals(t.size(), s.length);
        assertEquals(stuff.size() / 2, s.length);
    }
Check ArraySet seems to work. :)

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