@Test
    public void testIterator() {
        Set<ActorId> ids = new java.util.HashSet<ActorId>();
        ActorSet as = new ActorSet();
        for (int i = 0; i < 1024; i ++)
            as.add(new TestActor(Vector3f.newRandom(100)));


        for (Actor a: as) {
            assertTrue(a instanceof TestActor);
            assertTrue(ids.add(a.id));
        }
        assertEquals(1024, ids.size());
        assertEquals(1024, as.size());

        for (int i = 0; i < 1024; i ++)
            as.add(new TestActor(Vector3f.newRandom(100)));
        assertEquals(2048, as.size());

        int count = 0;
        for (Actor a: as) {
            assertTrue(a instanceof TestActor);
            ids.add(a.id);
            count ++;
        }
        assertEquals(2048, ids.size());
        assertEquals(2048, count);
    }