private List<Integer> buildSubSet(final int targetSize,
            final TinyIdentitySet<Integer> t, final Integer[] instances) {
        for (int i = 0; i < targetSize; ++i) {
            instances[i] = Integer.valueOf(i);
            t.add(instances[i]);
        }
        final List<Integer> subset = new ArrayList<>(50);
        for (int i = 0; i < targetSize; ++i) {
            if (i % 2 != 0) {
                subset.add(instances[i]);
            }
        }
        return subset;
    }
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