             
             var testMethodsArray:Array = getTestMethods(test);
             if (!testMethodsArray.length) {
-                testMethods        = new ArrayIterator();
-                beforeClassMethods = new ArrayIterator();
-                beforeMethods      = new ArrayIterator();
-                afterMethods       = new ArrayIterator();
-                afterClassMethods  = new ArrayIterator();
-                ignoredMethods     = new ArrayIterator();
+                setUpNullIterators();
                 return;
             }
             


    import p2.reflect.Reflection;
    import p2.reflect.ReflectionMethod;


    public class TestIterator implements Iterator {
        

                );
            }
            
            testMethods = new ArrayIterator(testMethodsArray);
            setUpIterators(test);
        }

        private function setUpNullIterators():void {
            // Set up null iterators for access to length
            // and other properties...
            testMethods        = new ArrayIterator();
            beforeClassMethods = new ArrayIterator();
            beforeMethods      = new ArrayIterator();
            afterMethods       = new ArrayIterator();
            afterClassMethods  = new ArrayIterator();
            ignoredMethods     = new ArrayIterator();
        }

        private function setUpIterators(test:Object):void {
            afterClassMethods   = new ArrayIterator(getAfterClassMethods(test));
            afterMethods        = new ArrayIterator(getAfterMethods(test));
            beforeClassMethods  = new ArrayIterator(getBeforeClassMethods(test));
            beforeMethods       = new ArrayIterator(getBeforeMethods(test));
            ignoredMethods      = new ArrayIterator(getIgnoredMethods(test));
        }

